Transformation of Date
Mostrar comentarios más antiguos
Hi,
I have a issue with several dates that I receive from a macro with numeric format. Then, When I want to transform to string format in matlab, the date doesn't keep the original format.
For example:
12/03/11 05:04:30 --> num --> datestr(num,'dd-mm-yy HH:MM:SS')--> 13/03/0111 05:04:30
How can I revolve this issue?
thanks
regards
Respuesta aceptada
Más respuestas (2)
Jan
el 24 de Feb. de 2011
Extremely strange. Please edit your question and insert the original code you used for this and mention the Matlab version.
In Matlab 2009a I get:
S = '12/03/11 05:04:30'
num = datenum(S)
datestr(num, 'dd-mm-yy HH:MM:SS')
>> '03-12-11 05:04:30'
The result is as expected. The result you get '13/03/0111 05:04:30' is surprising: where do the '/' come from?!
Andreas Goser
el 24 de Feb. de 2011
1 voto
Please note the following solution: Why do I see different results when passing dates from Excel into MATLAB?
1 comentario
Mtlb Usr
el 24 de Feb. de 2011
Categorías
Más información sobre Time Series Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!