Reading time from the year numbers, day numer and hour number
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi everyone! How to extract the time from the year number, day number and hour number and combine them into single date time. Example yyyy-mm-dd HH:MM:SS.
Here is one of the sample data:
yearnumber=2019.24917302
day_number=91.19733;
hour_number=4.73580;
댓글 수: 2
채택된 답변
Star Strider
2021년 5월 30일
I cannot find a way using the MATLAB date and time functions to convert these automatically.
Try this —
year_number=2019.24917302;
day_number=91.19733;
hour_number=4.73580;
Convert = @(year_number,hour_number,day_number) datetime([fix(year_number) fix(rem(year_number,1)*12) fix(day_number) fix(hour_number) fix(rem(hour_number,1)*60) 0]);
Out = Convert(year_number,hour_number,day_number)
.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!