How to change the system date from the shell on FreeBSD?

The system date and time can be changed with the date command.

Set Date only

date YYMMDD

or

date YYYYMMDD

Set Date and Time

date YYMMDDHHMM

or

date YYYYMMDDHHMM

Set Time only

date HHMM

Example
So for example, if you want to set the date to Nov. 6, 2009 and the time to 8:58, you would use this command:

# date 0911060858

See man date for more information.

Leave a Reply

How to post code in comments?