If you have a file on your Mac and you want to change its created date and time (timestamp) then you can do that using the Terminal app as follows.
% ls -l | grep myfile.csv
-rw-r--r-- 1 c2ctechtv staff 0 Sep 7 12:51 myfile.csv
Here, we have a file myfile.csv with the created date as September 7th at 12:51 hours.
Now let's change this date to 4th of July 2023 and time as 03:00 hours.
% SetFile -d '07/04/2023 03:00:00' myfile.csv
If you want, you can also create a file with a date for the future or past using the touch command and -mt flag.
Syntax:touch -mt YYYYMMDDhhmm <file-name.extension>
Example:
touch -mt 202101010100 myfile.csv

Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!