date to number

Hi How to change the date with this format to number: 09-08-01 00:56:33
Thanks

3 comentarios

Walter Roberson
Walter Roberson el 18 de En. de 2012
09-08-01 ... any of those could be a year, month, or day. You need to clarify which order the components are in.
bahare
bahare el 19 de En. de 2012
09:2009
08: August
01: day
Jan
Jan el 19 de En. de 2012
What is the wanted number exactly? A datevec or a datenum?

Respuestas (1)

sunil anandatheertha
sunil anandatheertha el 19 de En. de 2012

0 votos

Try using this for general purposes: a=clock;a(1),a(2),a(3),a(4),a(5),a(6)
Assuming the 09-08-01 00:56:33 to be,
day-month-year hrs:mins:secs, you can try using the following
a = '09-08-01 00:56:33'
day = str2num(a(1:2))
month = str2num(a(4:5))
year = ...
and so on. Hope this helped..

La pregunta está cerrada.

Etiquetas

Preguntada:

el 18 de En. de 2012

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by