4

I'd like to create a file with an invalid created/modified/accessed timestamp. To be invalid it should be a date and time before 12:00 midnight January 1, 1601 C.E. UTC

2
  • Why would you want to do this? – Rowland Shaw Oct 7 '10 at 12:28
  • 2
    So that I can test that the application I'm writing can handle corrupt timestamps gracefully. – Tom Robinson Oct 7 '10 at 12:30
3

Look for a tool called Timestomp

The software's goal is to allow for the deletion or modification of time stamp-related information on files.

6

This is not possible.

File time is used in Windows API through the FILETIME Structure, described as:

Contains a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).

As negative values are not supported, the above date is the starting limit.

Conclusion: Your code which tests for earlier dates will never be challenged.

1
  • 2
    The "touch" command in Linux can create such a file, but under Windows it is recognized as being created today. (Tested with FAT32 Flashdrive and Win XP) – user16115 Oct 7 '10 at 14:03

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.