Format of datestr() changes

1 visualización (últimos 30 días)
Helma Maria Tróndheim
Helma Maria Tróndheim el 12 de Oct. de 2017
Comentada: Peter Perkins el 13 de Oct. de 2017
Hi,
I'm was using datestr() to get the date string instead of number, when I realised that the format of the string changes. I've data over a year with a minute interval.
January-April, June-September and November show the date like this: dd.mm.yyyy HH:MM
while May, October and December show it like this: dd-mmm-yyyy HH:MM:SS
Why is that?
  6 comentarios
Walter Roberson
Walter Roberson el 12 de Oct. de 2017
Have you attempted doing the reading using readtable() and getting datetime objects instead of having to convert yourself ?
Peter Perkins
Peter Perkins el 13 de Oct. de 2017
As Walter says, readtable is a much better choice for reading dates from an Excel file than xlsread.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Dates and Time en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by