Display time as Day, Month Year

조회 수: 2 (최근 30일)
Madison
Madison 2023년 7월 25일
댓글: Star Strider 2023년 7월 25일
I'm trying to read my time data from an nc file in the format of (dd mm yy), but it looks like it's displaying the data as hours minutes and seconds maybe?
My time data looks like this
725889600
725976000
726062400
726148800
726235200
726321600
726408000
726494400
726580800
726667200
726753600
726840000
726926400
727012800
727099200
727185600
727272000
727358400
727444800
727531200
  댓글 수: 1
Dyuman Joshi
Dyuman Joshi 2023년 7월 25일
How are you reading it?
Also, can you attach your data file? Use the paperclip button to do so.

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

채택된 답변

Star Strider
Star Strider 2023년 7월 25일
I experimented with a few conversions, and 'posixtime' is the only one that producs realistic results.
Try this —
TN = [725889600
725976000
726062400
726148800
726235200
726321600
726408000
726494400
726580800
726667200
726753600
726840000
726926400
727012800
727099200
727185600
727272000
727358400
727444800
727531200 ];
DT = datetime(TN, 'ConvertFrom','posixtime', 'Format','dd MM yyyy')
DT = 20×1 datetime array
01 01 1993 02 01 1993 03 01 1993 04 01 1993 05 01 1993 06 01 1993 07 01 1993 08 01 1993 09 01 1993 10 01 1993 11 01 1993 12 01 1993 13 01 1993 14 01 1993 15 01 1993 16 01 1993 17 01 1993 18 01 1993 19 01 1993 20 01 1993
What are the expected years, months, and days?
  댓글 수: 2
Madison
Madison 2023년 7월 25일
Yes, that is right!Thank you!
Star Strider
Star Strider 2023년 7월 25일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

제품


릴리스

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by