SOS: How to convert serial date number back to date, in the format of mm/dd/yyyy?
Thanks SO MUCH!!

 Réponse acceptée

Sean de Wolski
Sean de Wolski le 16 Juin 2011

1 vote

datevec or datestr
doc datevec
doc datestr
%For future reference: since you're using datenum, the conversions are probably related to it; if you look at the bottom of:
doc datenum
it has the inverses.

1 commentaire

Zoe
Zoe le 16 Juin 2011
I ll be careful next time! Thanks a lot!~~

Connectez-vous pour commenter.

Plus de réponses (2)

Walter Roberson
Walter Roberson le 16 Juin 2011

3 votes

datestr(serialnum, 'MM/DD/YYYY')

2 commentaires

Zoe
Zoe le 16 Juin 2011
Thanks a lot :)
George Scott
George Scott le 17 Juil 2018
'mm/dd/YYYY' ('MM' is a minutes format, not months)

Connectez-vous pour commenter.

Peter Perkins
Peter Perkins le 3 Août 2018

0 votes

The longer answer is, Don't use datenum and datestr at all if you can avoid it. Use datetime, no conversion back and forth between number and text necessary.

Catégories

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by