Changing File Dates on a Mac
How to change the date of a file
To change either the created or modified date for a file, you need to use Terminal. It’s not difficult, and you’ll need only one command, but it’s important to get the formatting right. The date and time format for each method is different, so make sure you use the correct one.
To change the created date:
- Launch Terminal.
- Type the command:
SetFile -d ‘MM/DD/YYYY hh:mm:ss’
- Replace ‘MM/DD/YYYY hh:mm:ss’ with the date and time you want to set for the created date and time so, for example, 24 March 2022 would be ’03/24/2022’ and 10:05am would be ’10:05:00’
- Type a space.
- Drag the file which date you want to change onto the Terminal window.
- When its file path appears, press Return.
To change the modified date:
In Terminal, type:
touch -t YYYMMDDhhmm
Replace ‘YYYMMDDhhmm’ with the date and time you want to change to.
Press the spacebar.
Drag the file whose date you want to change onto the spacebar.