필터 지우기
필터 지우기

Time data conversion

조회 수: 2 (최근 30일)
jason beckell
jason beckell 2012년 1월 25일
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.

채택된 답변

Walter Roberson
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.

추가 답변 (1개)

Andrew Newell
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')

카테고리

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