cmos clock to utc time code?

Philip M. Gollucci pgollucci at
Thu Nov 8 18:44:14 PST 2007

jekillen wrote:
> Hello again;
> Here I am with another awkward question:
> I have set up ntp and it is complaining that
> the time difference is too great; 3606 or so
> seconds, and wants the system clock set to
> utc. I rebooted and entered bios set up
> but I did not see any explicit clues on how
> to set this clock to utc. (0r even if it is possible).
> The motherboard is ECS w/AMD64. I did
> not catch the bios vendor or version. If  I have
> to I will reboot again to look at it or dig up the
> manual for the motherboard.
> I tried sysinstall but it just asks if the system
> clock is set to utc. (thus the question here)
> Any advice, suggestions, info appreciated;
> Thanks in advance
> Jeff K
This doesn't really have anything to do with your CMOS clock.

sysctl kern.securelevel

at > 1, you can't change the clock by more than 1 second.

man 7 securelevel

Look for phrase - 'The security levels are:'

You can't lower it without rebooting.
You can change it in /etc/rc.conf(5).

$ grep secure /etc/rc.conf

Or your could boot single user mode and run ntpdate once yourself since
the securelevel (securit level) isn't set until you go multi-user mode.
$ ntpdate

HOWEVER, I recommend the new fangled way you are supposed to do this:
1) Enable it in /etc/rc.conf(5)
  echo 'ntpd_enable="YES"' >> /etc/rc.conf
  echo 'ntpd_sync_on_start="YES"' >> /etc/rc.conf

2) Create /etc/ntp.conf(5)
  echo "server" > /etc/rc.conf
  echo "driftfile /var/db/ntp.drift" >> /etc/rc.conf

Use time servers close to you though and more than 1.

3) Reboot

Finally, about the timezone
By default sysinstall(8) copies a file from /usr/share/zoneinfo to /etc
as file localtime based on your choices during the install.  You can
even run sysinstall again to update it post install.

ls -l /etc/localtime
-r--r--r--  1 root  wheel  -  1.2K Jul 25 14:58:48 2007 /etc/localtime

HOWEVER, its easier to just create a symlink to the one you want.
If you want your system to run in utc time do this:
cd /etc
sudo rm -rf /etc/localtime
sudo ln -s /usr/share/zoneinfo/etc/UTC localtime

Test it:
$ date

(bash syntax)
$ TZ=America/New_York date


Check your ntpd(8) communications with time servers:
$ ntpq -p
     remote           refid      st t when poll reach   delay   offset
*ntp-1.cns.vt.ed    2 u   97 1024  377   15.690   37.394

Philip M. Gollucci (philip at
Senior System Admin - Riderway, Inc. /
1024D/EC88A0BF 0DE5 C55C 6BF3 B235 2DAB  B89E 1324 9B4F EC88 A0BF

Work like you don't need the money,
love like you'll never get hurt,
and dance like nobody's watching.

More information about the freebsd-questions mailing list