Format of datestr() changes
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Walter Roberson
le 12 Oct 2017
Have you attempted doing the reading using readtable() and getting datetime objects instead of having to convert yourself ?
Peter Perkins
le 13 Oct 2017
As Walter says, readtable is a much better choice for reading dates from an Excel file than xlsread.
Réponses (0)
Voir également
Catégories
En savoir plus sur Dates and Time dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!