Change the Modification and Creation dates of a file - Sonoma 2024

People seem to have a lot of trouble in the past changing these dates, but I've successfully used the base level touch -t in Terminal:

To change the creation date of a file in terminal paste in the below: (that will make the date 2001, january 15, 11:50pm - change it to the date you want - format is YYYYMMDDhhmm)


 touch -t 200101152350 


make sure there is a space after the last digit (this is where most people fail, inclucing myself until I realized it was missing.)

then drag the file into the terminal window so it populates it with the file path, then press return and it should work. Text should look like this before you press return:

touch -t 200101152350  /Users/g/Desktop/IMG_4074.jpg 



After pressing return, get info on the file and it should look like this

Mac Studio, 14.5

Posted on Jul 28, 2024 4:21 PM

Reply
5 replies

Aug 6, 2024 11:32 PM in response to G-manNYC

"Content Created" is ExifIFD:DateTimeOriginal internal metadata i.e. when the photo was taken.


Finder.app > View > Show Preview display this as "Content Created" and Preview.app > Tools > Show Inspector > Exif as "Date Time Original". I wish Apple used the same "Date Time Original" for this tag also in Finder.


In exiftool the internal metadata dates AND file system dates can be checked with something like:


exiftool -a -G1 -s -fileOrder5 FileName -api LargeFileSupport=1 -api QuickTimeUTC=1 -Time:All -api RequestAll=2 .


See also:


Movie dates and Photos.app - Apple Community


Jul 29, 2024 3:40 PM in response to Matti Haveri

Thanks Matti !!!, definitely setfile gives more options and is a good solution: I didn't include that because most people asking seem to have the issue of needing to revert the dates to the original file when they copy to a new location. I know you can go in and get it to find those original dates in the metadata and make an automation to apply, but I just wanted to offer a simple solution for people not used to terminal etc. I use this method a lot because I want both dates to change and only ever run into changing into prior dates, with my workflow.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Change the Modification and Creation dates of a file - Sonoma 2024

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.