1

According to Wikipedia, FAT32 has a date resolution of 2 seconds for last modified time. This file time is obtainable in WinAPI and as a DateTime in C# using File.IO, both of which this concerns.

What does the date resolution mean in practice? Does it mean that it can only timestamp the last modified file time in 2-second intervals, or does it mean that the dates it timestamped are only accurate within 2 seconds?

In other words (using a yyyy-MM-dd HH:mm:ss:fffffff DateTime format as examples), does it...

  1. Timestamp such that it is limited to 2-second even intervals of time, such as: 2015-07-16 14:28:36:0000000, 2015-07-16 14:28:38:0000000, 2015-07-16 14:28:40:0000000

...or...

  1. Arbitrarily timestamp, just that the time is only accurate within a certain interval: 2015-07-16 14:28:36:1234567 - meaning that the last write could have actually taken place anywhere from 2-seconds before this time (2015-07-16 14:28:34:1234567) all the way up to 2-seconds after this time (2015-07-16 14:28:38:1234567)?

  2. Something else?

Alexandru
  • 12,264
  • 17
  • 113
  • 208
  • 3
    Keep in mind also that FAT only records the *local* time. It is not aware of time zones. If you take a FAT formatted USB drive from one system to another, there's no guarantee the time zones will match. Additionally, it cannot disambiguate between times during the fall-back daylight saving time transition (such as when 01:00-01:59 is repeated in the US). NTFS records the UTC time, so it does not have this problem. – Matt Johnson-Pint Jul 20 '15 at 19:44
  • @MattJohnson Interesting, thanks for noting that. – Alexandru Jul 20 '15 at 21:01

1 Answers1

4

It means the number of seconds in the time can only be an even integral number.

The directory entry for the FAT file system only has a 5-bit field for storing the number of seconds in the time. This limits the number stored in the field to the range 0-31, which is multiplied by two to obtain the number of seconds. (Values of 30 and 31 in this field are invalid.)

Ross Ridge
  • 38,414
  • 7
  • 81
  • 112
  • Thanks so much. Awesome reference. Indeed, at offset 0x0E it shows that this value contains Seconds/2 (where Seconds can be from 0-29) within bits 4-0. Of these numbers (0-29), multiplying any of them by 2 to get the actual seconds produces a number that is limited to 2-second even intervals of time. – Alexandru Jul 20 '15 at 20:35