How to reverse datenum?

조회 수: 23 (최근 30일)
Zoe
Zoe 2011년 6월 16일
답변: Peter Perkins 2018년 8월 3일
SOS: How to convert serial date number back to date, in the format of mm/dd/yyyy?
Thanks SO MUCH!!

채택된 답변

Sean de Wolski
Sean de Wolski 2011년 6월 16일
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
Zoe
Zoe 2011년 6월 16일
I ll be careful next time! Thanks a lot!~~

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Walter Roberson
Walter Roberson 2011년 6월 16일
datestr(serialnum, 'MM/DD/YYYY')
  댓글 수: 2
Zoe
Zoe 2011년 6월 16일
Thanks a lot :)
George Scott
George Scott 2018년 7월 17일
'mm/dd/YYYY' ('MM' is a minutes format, not months)

댓글을 달려면 로그인하십시오.


Peter Perkins
Peter Perkins 2018년 8월 3일
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.

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by