converting number to date number
48 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
wesso Dadoyan
am 1 Okt. 2016
Beantwortet: Steven Lord
am 1 Okt. 2016
I have a column of dates that are number (double format) such as 19940127 how can i convert it to matlab numeric date that corresponds to 1994/01/27?
0 Kommentare
Akzeptierte Antwort
Star Strider
am 1 Okt. 2016
Bearbeitet: Star Strider
am 1 Okt. 2016
One approach:
dd = 19940127;
out = datestr(datenum(num2str(dd, '%d'), 'yyyymmdd'), 'yyyy/mm/dd')
out =
1994/01/27
To get the date number, just use part of that:
out_dn = datenum(num2str(dd, '%d'), 'yyyymmdd')
EDIT — Added ‘out_dn’.
0 Kommentare
Weitere Antworten (1)
Siehe auch
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!