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
-

Facing issues? Have Questions? Post them here! I am happy to answer!


Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

Copyright © Code2care 2023 | Privacy Policy | About Us | Contact Us | Sitemap