Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jun 2019 17:35:35 +0100
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: ntpd configutration -- a small suggestion from the peanut gallery
Message-ID:  <1e1c3403-fa5e-b540-e7b5-5b88af234947@FreeBSD.org>
In-Reply-To: <52339.1559763722@segfault.tristatelogic.com>
References:  <52339.1559763722@segfault.tristatelogic.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 05/06/2019 20:42, Ronald F. Guilmette wrote:
>> Anyway, even if it seems to work now, I'd check if your time is based on localtime or
>> GMT. It's recommended to use GMT, I never use localtime personally.

> For me, I prefer local time.  When I type "date" I don't really give a
> flying fig what time it is in London.  I'm in California.

That's not actually the effect removing /etc/wall_cmos_clock has.

Without /etc/wall_cmos_clock, the internal system clock is simply 
synchronized to the cmos clock at boot, and the cmos clock is synched 
back from the system clock at intervals when the system is running and 
on shutdown.  The cmos clock is the small, fairly cheap but not 
astonishingly accurate clock that runs off the battery on your 
motherboard, even when your machine is completely unplugged from the 
power, while the system clock is the kernel's idea of the current time 
based on a rather more accurate reference frequency generated from a 
quartz crystal resonator -- and that depends on the system being up and 
running to function.

Now, Unix-oid systems generally run their system clock in UTC.  They 
then calculate the time-of-day you see displayed in your shell by 
applying the appropriate offset calculated from the timezone setting -- 
either derived from /etc/localtime or from setting TZ in your 
environment.  Windows runs the system clock as the local wall clock time 
-- or at least, it used to.  No idea if that's still the case or not.

The advantage of the Unix way is that each different user, or even each 
different process, can easily run with a different timezone setting.

The effect of /etc/wall_cmos_clock is to tell the kernel to apply the 
timezone offset when it either updates the cmos clock, or updates the 
system clock from it.  Basically it's a hack to support dual-booting 
between Windows and FreeBSD, and if you never want to do that then your 
best choice is simply to keep cmos and system clocks synchronized on UTC 
so that there's no offset to calculate.

	Cheers,

	Matthew





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1e1c3403-fa5e-b540-e7b5-5b88af234947>