필터 지우기
필터 지우기

time conversion

조회 수: 3 (최근 30일)
Uday
Uday 2011년 9월 23일
I have some data which says that the available time is in fraction days since 01:01:2000 and another data has time in seconds , so somebody please tell me how I can convert this data to [Year Month Day Hour Minute Second format].

채택된 답변

Jan
Jan 2011년 9월 23일
DATENUM is a serial date format, which starts at 00-Jan-000. The integer part is the number of days, the fraction part is the time of the day divided by 86400. If I understand you question correctly, you need to add datenum('01-Jan-2000') to your time in "fraction day" and let datevec convert the serial date to a date vector.
If this does not help, please post an example of the input and output dates.
  댓글 수: 4
Uday
Uday 2011년 9월 23일
I used following codes
is it correct method ?
time=datenum(sec/86400+datenum('01-Jan-2005'));
Time_N=datevec(time); % here we can get [Year Month Day Hour Minute Second ]
Walter Roberson
Walter Roberson 2011년 9월 23일
That should be fine -- but watch out for leap seconds. MATLAB does not deal well with leap seconds.

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

추가 답변 (0개)

카테고리

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