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>
touch -mt 202101010100 myfile.csv
Facing issues? Have Questions? Post them here! I am happy to answer!
- Clear Screen shortcut macOS Terminal
- What is macOS Ventura?
- [fix] How to Show file extensions on all files on Mac
- How to Find Where Mac Terminal App is Located?
- AutoSave button not working on Office on Mac (Word, Excel or Powerpoint)
- macOS say command text to speech using various voices and languages
- How to change Ping TTL value on macOS
- Open .bash_profile File in TextEdit using Terminal
- How to know the Safari Version on Mac
- How to Copy full Absolute Path of a File on Mac
- 13.0 MacOS Ventura release date
- Enable spell check in Sublime Text (macOS)
- How to Display Analog Clock on Mac Menu Bar
- How to turn off Location Services macOS Ventura 13
- How to Open VS Code on Mac
- Add Bookmark macOS Safari
- How to Fix cd: too many arguments Error in Terminal: A Step-by-Step Guide
- How to install wget on macOS
- Select Line Number TextEdit on Mac
- Strikethrough Text in Excel for Mac
- How to Enable or Disable Dark Mode on macOS Ventura 13
- How to hide or display Wifi icon in macOS Bug Sur Menu Bar
- How to install Yarn on Mac (macOS)
- How to fix command not found brew (bash, zsh) on macOS Terminal
- How to Schedule Mails in macOS Ventura
- Path of homebrew (brew) installation in macOS Big Sur - MacOS
- Replace delimiter with new line in Notepad++ - NotepadPlusPlus
- How to destroy PHP session() - PHP
- Comparator with Lambda Examples - Java
- Fix RabbitMQ: AuthenticationFailureException: ACCESS_REFUSED - Java
- Notepad++ sort by name with example - NotepadPlusPlus
- Create Safari Shortcut on Mac Desktop - MacOS
- Java code to check Internet Connection on Android Device Programmatically - Android