Date conversion in a number format
显示 更早的评论
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.
采纳的回答
更多回答(1 个)
Walter Roberson
2014-3-27
datestr(datevec('03/06/2014 11:39:04.324 PM', 'MM/DD/YYYY hh:mm:ss.fff PM'), 'YYYYMMDDhhmmssfff')
2 个评论
Chandrasekhar
2014-3-27
so simple..
Walter Roberson
2014-3-27
You could also use datenum instead of datevec but I think datevec should be more resistant to round-off.
类别
在 帮助中心 和 File Exchange 中查找有关 Time Series Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!