Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How do I set the creation time of a file?

How can you create a files on a Mac that have a specific creation date (different from the current one)?

What I have found so far, touch can only alter the modified at time...

share|improve this question

marked as duplicate by patrix, user495470, jmlumpkin, bmike Aug 14 '12 at 18:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

How to change the creation date/time of a file in Lion? only mentions touch -t as well. – user495470 Jul 16 '12 at 16:48
@Lri, thank you: I didn't come across it in my searches. – Marius Butuc Jul 16 '12 at 18:26
up vote 2 down vote accepted

I believe you can do it with touch.

touch -t YYYYMMDDhhmm /filehere
share|improve this answer
touch -t normally only changes the modification date. The creation date is only changed if the new modification date would be before it. – user495470 Jul 16 '12 at 16:52
On 10.7, touch -t appears to work on my test system, even if the mod date is after. I used touch -mt to change the mod time and it works fine. – Richard Belisle Jul 16 '12 at 17:21
I meant that touch file.txt; touch -t 199901010000 file.txt would change the creation date, but touch file2.txt; touch -t 209901010000 file2.txt wouldn't. – user495470 Jul 16 '12 at 18:05
@RichardBelisle thank you: it works! – Marius Butuc Jul 16 '12 at 18:26

SetFile can also be used to set the creation date before the modification date or in the future.

-d date    Sets the creation date, where date is a string of the
           form: "mm/dd/[yy]yy [hh:mm:[:ss] [AM | PM]]" Notes:
           Enclose the string in quotation marks if it contains spa-
           ces. The date must be in the Unix epoch, that is, between
           1/1/1970 and 1/18/2038. If the year is provided as a two-
           digit year, it is assumed to be in the 21st century and
           must be from 00 (2000) through 38 (2038).

This would set the creation date to the modification date:

SetFile -d "$(GetFileInfo -m test.txt)" test.txt

SetFile and GetFileInfo are part of the command line tools package, which can be downloaded from or from Xcode's preferences after installing it from the App Store.

share|improve this answer
Awesome, thanks for finding this! – patrix Aug 7 '12 at 20:10

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