How to Set Date Time from Mac Command Line

How to Set Date Time from Mac Command Line

Engaged on an online extension that ships to an app retailer and is not instantly modifiable, like a web site, will be troublesome. Since you can’t instantly deploy updates, you generally have to bake in hardcoded date-based logic. Testing future dates will be troublesome if you do not know the right way to shortly change the date in your native machine.

To vary the present date in your Mac, execute the next from command line:

# Date Format:  MMDDYYYY
sudo date -I 06142024

This command doesn’t modify time, solely the present date. Utilizing the identical command to reset to present date is simple as effectively!

Leave a Reply