18

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?

0

5 Answers 5

18

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.

1
  • It was rar-ed, gpg-ed and emailed. Since the timestamp of modification was earlier than the one of creation, I guess it survived correctly.
    – bastibe
    Commented Feb 16, 2010 at 21:04
6

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.

4

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

3
  • That might be a problem... Thanks for pointing this out!
    – bastibe
    Commented Feb 16, 2010 at 18:02
  • 4
    Just to clarify, there's no actual field for the timezone, but since all times are stored in UTC and then converted to the local time on the fly in Explorer, that's a non-issue. Commented Feb 16, 2010 at 18:18
  • 3
    from a user experience point-of-view, the first statement seems correct, but from a technical standpoint it's flat out wrong. your clarification gets it right, though, and you should really edit your answer to state that directly. Commented Feb 17, 2010 at 11:01
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.

1
  • 1
    +1 EXIF usually just stores local time, and does not have a way to indicate a time zone :-(
    – sleske
    Commented Jul 4, 2010 at 22:05
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.

3
  • 2
    Or, during daylight savings time. Commented Mar 13, 2013 at 19:52
  • The same applies to files inside ZIP archives since the format inherits the FAT16 timestamp formatting (2-second accuracy and no time zone info).
    – rustyx
    Commented Apr 22, 2016 at 8:52
  • @rustyx That's sad the ZIP files don't preserve the timezone info and time accuracy to the realm of nanoseconds. I wonder if .7z format or .rar format preserve timezone info and file creation date to the nanosecond.
    – Rublacava
    Commented Sep 20, 2020 at 0:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .