Shift in datetime relative to epoch
Ältere Kommentare anzeigen
When I use "datetime" to convert seconds since an epoch (like unix time stamp, GPS time) I get on one PC the result shifted by 12 hours:
datetime(0,'convertfrom', 'epochtime','Epoch','1970-01-01 00:00:00')
ans =
datetime
1970-01-01 12:00:00.000
I only get this on one PC with 2018b, but not in 2016b. Also on another computer with 2018b I get what I expect:
ans =
datetime
1970-01-01 00:00:00.000
I am not sure what causes this shift. I do not think it can be related to time zones, it should only be +-1h.
1 Kommentar
Steven Lord
am 25 Mai 2023
I agree with Cris's suspicion. I'd check that the default format is the same between the two machines. See the Preferences for the Command Window.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!