Change a file’s creation/modified date on Mac OS X

This is a very simple guide on how to change a file’s creation date or last modified date attributes on Mac OS X.  Based on Snow Leopard 10.6, this should work on previous versions of Mac OS X.


Date Format Key:

     YYYY – The year (the first two digits/century can be omitted)
     MM – The month of year, from 01 to 12
     DD – The day of the month, from 01 to 31
     hh – The hour of the day, from 00 to 23
     mm – The minute of the hour, from 00 to 59

Creation Date – Single file

How to change the creation date attribute of a single file:
Note: changing the creation date attribute will also change the modified date attribute and set it the same as the creation date.

  1. Start the Terminal application (/Applications/Utilities/Terminal.app) or if you prefer use iTerm.
  2. Type the following in the command line, but do not hit enter/return.  Replace YYYYMMDDhhmm with the desired date information:
    touch –t YYYYMMDDhhmm
  3. Open a Finder window and locate the file you wish to modify.  Drag and drop the file into the Terminal window, the file and path will be added to the end of the line you just typed. 

    Here is an example of what the line should look like:

    touch –t 200005151125 /Volumes/Mac\ HD/Pictures/myfile.jpg

    200005151125 in the example above represents 15th May 2000 11:25 AM.

  4. If all is in order press the enter/return key.  The creation date should now be changed to the date specified above, as well as the last modified date.

Modified Date – Single file

How to change the last modified date attribute of a single file:

  1. Start the Terminal application (/Applications/Utilities/Terminal.app) or if you prefer use iTerm.
  2. Type the following in the command line, but do not hit enter/return.  Replace YYYYMMDDhhmm with the desired date information:

    touch –mt YYYYMMDDhhmm

  3. Open a Finder window and locate the file you wish to modify.  Drag and drop the file into the Terminal window, the file and path will be added to the end of the line you just typed. 

    Here is an example of what the line should look like:

    touch –mt 201006301525 /Volumes/Mac\ HD/Pictures/myfile.jpg

    201006301525 in the example above represents 30th June 2010 3:25 PM.

  4. If all is in order press the enter/return key.  The last modified date should now be changed to the date specified above.

Creation Date – Multiple files

How to change the creation date attribute of multiple files:

Note: changing the creation date attribute will also change the modified date attribute and set it the same as the creation date.

  1. Make sure all the files you want changing are in the top directory of the same folder.  Do not place files in this folder if you don’t want them to be modified.
  2. Start the Terminal application (/Applications/Utilities/Terminal.app) or if you prefer use iTerm.
  3. Type the following in the command line, but do not hit enter/return.  Replace YYYYMMDDhhmm with the desired date information:

    touch –t YYYYMMDDhhmm
  4. Open a Finder window and locate the folder containing the files you wish to modify.  Drag and drop the folder into the Terminal window, the folder and path will be added to the end of the line you just typed. 

    Here is an example of what the line should look like:

    touch –t 201004270930 /Volumes/Mac\ HD/Pictures/Album

    201004270930 in the example above represents 27th April 2010 09:30 AM.

  5. Add /* to the end of the command.  If you’re only targeting a specific file type include its extension (e.g. /*.jpg).  Your command should look something like this:
    touch –mt 201004270930 /Volumes/Mac\ HD/Pictures/Album/*

    or

    touch –mt 201004270930 /Volumes/Mac\ HD/Pictures/Album/*.jpg
  6. If all is in order press the enter/return key.  The creation date should now be changed to the date specified above, as well as the last modified date, for all the files within that folder.

Modified Date – Multiple files

How to change the last modified date attribute of multiple files:

  1. Make sure all the files you want changing are in the top directory of the same folder.  Do not place files in this folder if you don’t want them to be modified.
  2. Start the Terminal application (/Applications/Utilities/Terminal.app) or if you prefer use iTerm.
  3. Type the following in the command line, but do not hit enter/return.  Replace YYYYMMDDhhmm with the desired date information:

    touch –mt YYYYMMDDhhmm
  4. Open a Finder window and locate the folder containing the files you wish to modify.  Drag and drop the folder into the Terminal window, the folder and path will be added to the end of the line you just typed. 

    Here is an example of what the line should look like:

    touch –mt 201006081015 /Volumes/Mac\ HD/Pictures/Album

    201006081015 in the example above represents 8th June 2010 10:15 AM.

  5. Add /* to the end of the command.  If you’re only targeting a specific file type include its extension (e.g. /*.jpg).  Your command should look something like this:
    touch –mt 201006081015 /Volumes/Mac\ HD/Pictures/Album/*

    or

    touch –mt 201006081015 /Volumes/Mac\ HD/Pictures/Album/*.jpg
  6. If all is in order press the enter/return key.  The last modified date should now be changed to the date specified above, for all the files within that folder.

Hope you found this tutorial somewhat useful.

66 comments

  1. Thanks a ton for all this help!

    I’ve been playing around in OS Sierra 10.12.6 on a MacBook Air. Here’s what I’ve figured out for completely wiping the Created and Modified dates. It’s likely that truly expert users (with or without digital forensics software) will still be able to discover the original dates, but this works extremely well for me. It’s also free and quite simple.

    1. Download EXIF Purge app for free from exifpurge.com

    2. Run EXIF Purge on all the files you want to change

    3. Now open Terminal and run the touch -t or touch -ct command using a very early date. Dates from 1903 and 1902 work particularly well. I’ve been using 190201010101. So the command would read: touch -t 190201010101 /Users/name/Documents/newphotos/*

    Once you’ve done that it should be very difficult for non-expert users to figure out when the files you’ve purged and altered were created or modified. All the date fields (except Last Opened) should be blank (- -) in the Finder as well as in image applications.

    A final note: As far as I can tell, the earliest you can change the date to is 190201010101 (i.e. the first second of year 1902). Dates between 1904 and the present show up in the date fields in Finder. If you pick a date/time from 1902 or 1903, however, the Created and Modified fields read blank: – -

    There are other methods that likely work as well or better than the above, but the steps I’ve been using have the advantage of being easy and free. The SetFile commands mentioned by user maverick require Xcode installation, I believe. They are discussed more here: medium.com/@jamj/this-can-be-done-using-the-setfile-command-which-is-a-part-of-command-line-tools-for-xcode-you-do-7ed46f367a4f. And applications like File Changer 5 are not free.

Leave a Reply to jer Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>