convert int32 dates to matlab date (datenum)
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I work on netcdf4 file of a 2D model output. Date datatype is int32, how can I convert this into matlab date (datenume) or datetime?
Thanks.
0 个评论
回答(1 个)
Stephen23
2023-4-3
编辑:Stephen23
2023-4-3
"Date datatype is int32"
You did not tell us the most important information, which is the epoch and step size.
Assuming that those dates are UNIX format (ie. epoch 1st Jan 1970, 1 second steps) then use DATETIME like this:
U = uint32(1680508182)
D = datetime(U,'convertfrom','posix')
1 个评论
另请参阅
类别
在 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!