How to Change Mac Date and Time using Terminal Command

If you want to display the date and time on your Mac Terminal, you can make use of the date command.

Example:
% date

Thu Sep 6 11:56:15 EST 2023

If you wish to change the date and time of your Mac device, you can make use of the same date command with elevated privileges as follows,


Change Date and Time

% sudo date 090712002023.30

Password:
Thu Sep  7 12:00:30 EST 2023

The date/time format string: mmddHHMMyyyy.ss


FormatDescriptionValid Values
mmMonth (01-12)01 to 12
ddDay (01-31)01 to 31
HHHour (00-23)00 to 23
MMMinute (00-59)00 to 59
yyyyYear (e.g., 2021)Any valid year
ssSecond (00-61)00 to 61 (allowing for leap seconds)

Change Date and Time using Mac Terminal

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!