datetime - Python: os.path.getmtime() for TZ agnostic timestamps originating from SD cards with different formats -
(note: may superuser question, since deals more how computer interprets timestamp... has implications programming deals timestamps originating external device.)
problem construction:
- format 3 sd cards in fat32, ntfs, , exfat
- create file on each of them using tz agnostic device (eg camera, or scientific instrument set time , date, no tz) @ precisely 12:00:00
- copy 3 files computer on california time (utc-7)
- run python:
os.path.getmtime()
on each. results vary.
it seems #3 critical step. here believe happens timestamps -- can confirm if correct?
- since fat32 records timestamps in localtime, computer assumes file created @ 12:00:00 california time (utc-7) , copies file timestamp of 19:00:00 (utc)
- since ntfs records timestamps in utc, computer assumes file created @ 12:00:00 utc, , copies file timestamp of 12:00:00 (utc)
- since exfat odd, stores in utc -- can include tz offset in master record -- assumptions go out window. does computer assume utc or utc-7 copies exfat timestamp without tz offset?
related:
how correct modified datetime of fat32 file, regardless of timezone in .net?
Comments
Post a Comment