convert int32 dates to matlab date (datenum)
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Stephen23
am 3 Apr. 2023
Bearbeitet: Stephen23
am 3 Apr. 2023
"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 Kommentar
Peter Perkins
am 5 Apr. 2023
Stephen kind of buried the lede, which was "use DATETIME", not datenum.
Siehe auch
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!