How to convert datetime

조회 수: 1 (최근 30일)
Kim NamHoon
Kim NamHoon 2016년 3월 15일
답변: Peter Perkins 2016년 3월 18일
I have a this type of datetime data.
Time1 = 5.060611138352190e+14; Time2 = 0.376712962962963;
Then, I want to convert this to [YearAD Month Day Hour Minute Second Millisecond] or something.
Please help me how to convert this.
Sincerely.
  댓글 수: 1
KSSV
KSSV 2016년 3월 15일
datevec shall work.But your Time1 seems very big. Are you sure the values are correct?

댓글을 달려면 로그인하십시오.

답변 (2개)

Yuebin Zhou
Yuebin Zhou 2016년 3월 17일

Peter Perkins
Peter Perkins 2016년 3월 18일
You're going to need to say what those two numbers, which differ by 15 orders of magnitude, are supposed to represent. The first one is larger than the number of ms since year zero, and smaller than the number of ns since 1900, so who knows what it is:
>> milliseconds(datetime - datetime(0,1,1))
ans =
6.3626e+13
>> 10^6 * milliseconds(datetime - datetime(1900,1,1))
ans =
3.6673e+18
The second is, well, it could be anything.

카테고리

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