Manually adjust date and time in FreeBSD

Just the other day, the following message appeared on my FreeBSD 10 virtual machine when first booted up:

root@bsd:~ # sMay  5 07:47:24 bsd ntpd[743]: time correction of 18001 seconds exceeds sanity limit (1000); set clock manually to the correct UTC time.

 

To display the current time and date, type the date command:

$ Date

The output of the date command is:

Mon May 5  07:47:53 CDT 2014

 

To set the time and date, the user must be superuser or root and the following format utilized:

date ccyymmddHHMM.ss

Referencing the date man page,

        • cc – Century (either 10 or 20) prepended to the abbreviated year.
  • yy – Year in abbreviated form (e.g., 14 for 2014)
  • mm – Numeric month from 1 to 12
  • dd – Day, from  1 to 31
  • HH – Hour, from 0 to 23
  • MM – Minutes, from 0 to 59
  • ss – Seconds, from 0 to 61 (59 plus a maximum to two leap seconds)

Example:

To change the date to May 5, 2014 10:05:33, type the following command at the prompt:

$ date 201405051005.33

 

To change the time zone, type the tzsetup command:

$ tzsetup

As always, please consult the man pages for date and tzsetup for additional information and configuration settings at www.freebsd.org.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *