BSD Clock

On BSD, the clock generally uses UTC time with a timezone offset in software, as opposed to local time.


Date and Time

Use date(1) as the root user to set the current date and time.

# January 1st, 2001 at 12:30
date 0101011230

The CMOS clock is automatically updated to match the system clock.


Timezone

The configured timezone is set in /etc/localtime. By standard convention, this should be a symbolic link to a pre-prepared file, typically under /usr/share/zoneinfo.

To check the current configuration, try:

realpath /etc/localtime

To change the configuration, try:

ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime

Consider using the interactive tzsetup(8) utility.

Some utilities will also respect a TZ environment variable.

export TZ=America/New_York
date


CategoryRicottone

BSD/Clock (last edited 2023-06-29 17:14:34 by DominicRicottone)