Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
    
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. –  tjrobinson Oct 7 '10 at 12:30
add comment

2 Answers

up vote 3 down vote accepted

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.

share|improve this answer
add comment

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.

share|improve this answer
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) –  bytesum Oct 7 '10 at 14:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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