1

I want to set the created date on some old scanned pictures to a date in 1970. If I do that using a third party tool, Windows explorer displays the date as blank. I thought NTFS could go back to the 1600s some time. What is going on?

  • @Ed: What does the dir command show for the date? – grawity Aug 14 '14 at 5:54
  • dir /tc shows the correct date – Ed Burdick Aug 14 '14 at 13:05
  • By the way, Photoshop Bridge also shows the correct date. – Ed Burdick Aug 14 '14 at 13:12
1

Quick analysis

When browsing folders, Windows Explorer won't display dates outside a specific range:

The MS-DOS date format can represent only dates between 1/1/1980 and 12/31/2107.

Source: FileTimeToDosDateTime function

This can be confirmed by manually setting the date:

Screenshot 1

My assumption is that this behavior is related to backward compatibility. When NTFS didn't exist, the created, modified, and access dates were designed to take 16 bits each (2 bytes). The information gets packed like this:

Bits | Description
-------------------------------------------------------
0–4  | Day (1-31)
5–8  | Month (1 = January, 2 = February, etc.)
9-15 | Year offset from 1980 (0 = 1980, 1 = 1981, etc.)

To save bits, the year isn't stored as a whole number; an offset is used instead. Since there are 7 bits, that means 2^7 = 128 possible values, i.e. 1980-2107.

As for NTFS, this is what the documentation says:

A file time is a 64-bit value that represents the number of 100-nanosecond intervals that have elapsed since 12:00 A.M. January 1, 1601 Coordinated Universal Time (UTC). The system records file times when applications create, access, and write to files.

The NTFS file system stores time values in UTC format, so they are not affected by changes in time zone or daylight saving time. The FAT file system stores time values based on the local time of the computer.

Source: File Times

Further reading


Workaround

In certain cases you might be able to bypass this issue through EXIF tags:

Screenshot 2

The file properties dialog can display any date supported by the underlying file system:

Screenshot 3

Same goes with the command-line interface when using the dir command:

01/01/1601  02:23 AM                 0 1-oldest.txt
01/01/1970  02:23 AM                 0 2-older.txt
01/01/1980  02:23 AM                 0 3-old.txt
01/01/2014  02:23 AM                 0 4-current.txt
01/01/2107  02:23 AM                 0 5-new.txt
01/01/9999  02:23 AM                 0 6-newer.txt

Third-party programs such as 7-Zip might also be unaffected:

Screenshot 4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.