19

I have a file that was modified either before or after it was sent to me.
However, it was created in a different time zone, so if the modification date is in the timezone of the sender, he was the last to modify it. If it is in my timezone, I modified it.

So, do you know if Windows file modification dates are timezone aware?

Jens Erat
  • 18,485
  • 14
  • 68
  • 80
bastibe
  • 3,912

5 Answers5

19

The time zone is an artefact of conversion from "instants" to a human-readable date-and-time in some calendar.

Computers do not like human-readable formats (not as much as humans, at least), so they usually store instants in a zone-neutral format. For instance, in the NTFS file system, time stamps are stored in UTC.

Hence, the file time modification is stored properly as long as whoever modifies it knows the current time. If your Windows system displays "13:19" and believes to be in the GMT-5 time zone, then it infers that the current instant is "18:19" in UTC, and writes as much in the NTFS entrails. However, if the OS displays "13:19" but believes to be in the GMT+3 time zone, then the OS is off by eight hours, even if, for the human looking at the screen, things seem fine.

Another point is that the file modification time is a property of the storage system in which the file is stored, e.g. a file system. When a file is "sent", then that time does not necessarily travels with it. Some archive formats (e.g. Zip) embed the file modification time along with the file. This does not apply to a file sent "as is", attached to an email, will not come with a file modification time.

7

You can see some hints in the Microsoft documentation for FILETIME. There is no provision for a time zone in the structure, but the text states that NTFS stores all file times in UTC.

Mark Ransom
  • 2,258
4

Windows timestamps are time zone aware. However, your mechanism for file transfer may not be.

3

As an addendum, note that while file modification dates from NTFS or other filesystems may be timezone aware, EXIF data (eg date/time a picture was taken with your camera) may very well not be, and may not be stored as UTC either so can prove tricky to convert. Just a thought, in case the file create / modify / EXIF date/time don't seem to agree.

I seem to recall Windows 7 improved on previous versions in terms of displaying EXIF data, ie converting it on the fly for diaply purposes to current local time if possible.

AdamV
  • 6,396
3

Remember that FAT filesystems are NOT timezone aware but this only affects you if you are carrying the file on a device with a FAT filesystem that is crossing timezones.

AnonF
  • 31