Format of datestr() changes

1 Ansicht (letzte 30 Tage)
Helma Maria Tróndheim
Helma Maria Tróndheim am 12 Okt. 2017
Kommentiert: Peter Perkins am 13 Okt. 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 Kommentare
Walter Roberson
Walter Roberson am 12 Okt. 2017
Have you attempted doing the reading using readtable() and getting datetime objects instead of having to convert yourself ?
Peter Perkins
Peter Perkins am 13 Okt. 2017
As Walter says, readtable is a much better choice for reading dates from an Excel file than xlsread.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Dates and Time finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by