How to reverse datenum?

25 visualizaciones (últimos 30 días)
Zoe
Zoe el 16 de Jun. de 2011
Respondida: Peter Perkins el 3 de Ag. de 2018
SOS: How to convert serial date number back to date, in the format of mm/dd/yyyy?
Thanks SO MUCH!!

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 16 de Jun. de 2011
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 comentario
Zoe
Zoe el 16 de Jun. de 2011
I ll be careful next time! Thanks a lot!~~

Iniciar sesión para comentar.

Más respuestas (2)

Walter Roberson
Walter Roberson el 16 de Jun. de 2011
datestr(serialnum, 'MM/DD/YYYY')
  2 comentarios
Zoe
Zoe el 16 de Jun. de 2011
Thanks a lot :)
George Scott
George Scott el 17 de Jul. de 2018
'mm/dd/YYYY' ('MM' is a minutes format, not months)

Iniciar sesión para comentar.


Peter Perkins
Peter Perkins el 3 de Ag. de 2018
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.

Categorías

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

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by