Date conversion in a number format
Ältere Kommentare anzeigen
Hey guys
I have an excel file with the date format like this: '03/06/2014 11:39:04.324 PM' I want to convert this date format into (yyyymmddhhmmssSSS)20140306233904324. If the time is PM, then the hour should be in the format of 24 hours. Thanks in advance.
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 27 Mär. 2014
datestr(datevec('03/06/2014 11:39:04.324 PM', 'MM/DD/YYYY hh:mm:ss.fff PM'), 'YYYYMMDDhhmmssfff')
2 Kommentare
Chandrasekhar
am 27 Mär. 2014
so simple..
Walter Roberson
am 27 Mär. 2014
You could also use datenum instead of datevec but I think datevec should be more resistant to round-off.
Kategorien
Mehr zu Time Series Objects finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!