I am using calls such as this in Python 3.4:
x = datetime.fromtimestamp(os.path.getctime(somefilename))
y = datetime.fromtimestamp(os.path.getmtime(somefilename))
Will x
and y
be timezone-aware, as per the definition of that term in the datetime documentation? Does this vary between platforms? I assume that in theory the ctime and mtime of a file are measured against the seconds since the epoch in UTC, so the answer should be yes?
If so, is that true across all/most POSIX platforms? Specifically, is it true on modern Linux/OS X?
If not, is there a better way to handle this? How can I get timezone-aware ctime and mtime data? What timezone do platforms use for expressing/storing ctime and mtime?