Time data conversion
2 次查看(过去 30 天)
显示 更早的评论
Hello to everybody!
I have a very simple question. Assuming that I have the following data
tn = datestr(t2-t1,'yyyy-mm-dd HH:MM:SS FFF')
tn =
2012-01-25 16:11:10 645
is there in Matlab a routine which automicatically translates into milliseconds? Thank you very much!
Jason.
0 个评论
采纳的回答
Walter Roberson
2012-1-25
Your question is not quite clear about what you want. One interpretation would be that you want
(t2 - t1) * (24 * 60 * 60 * 1000)
That is, serial date numbers are in full days, so multiply by 24 * 60 * 60 * 1000 to get the time difference as milliseconds.
0 个评论
更多回答(1 个)
Andrew Newell
2012-1-25
Here are two conversions you could do:
datevec('2012-01-25 16:11:10 645','yyyy-mm-dd HH:MM:SS FFF')
datenum('2012-01-25 16:11:10 645','yyyy-mm-dd HH:MM:SS FFF')
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!