Display time as Day, Month Year
2 次查看(过去 30 天)
显示 更早的评论
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
2023-7-25
How are you reading it?
Also, can you attach your data file? Use the paperclip button to do so.
采纳的回答
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')
What are the expected years, months, and days?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!