17.1 C
New York
Sunday, November 17, 2024

How to set the date and time from the Mac command line


Working on a web extension that is submitted to an app store and cannot be modified immediately, such as a website, can be difficult. Since you can’t deploy updates immediately, sometimes it’s necessary to incorporate hard-coded date-based logic. Testing future dates can be difficult if you don’t know how to quickly change the date on your local machine.

To change the current date on your Mac, run the following from the command line:

# Date Format:  MMDDYYYY
sudo date -I 06142024

This command does not modify the time, only the current date. Using the same command to reset the current date is easy too!


Related Articles

Latest Articles