[CLUE-Tech] Setting System Time

Dave Anselmi anselmi at americanisp.net
Fri Apr 12 14:20:01 MDT 2002


Warren wrote:

> Dave Anselmi <anselmi at americanisp.net> wrote:
>
>  > Did you check the hw clock in the cmos setup when you start the
>  > machine? If it isn't local time, change it there.
>
> When I first built the machine, it was on East Coast time.  I didn't
> reset it when I moved it to a colo facility out here.  But, wouldn't
> 'hwclock --systohc --localtime' set the clock the first time it ran?

> I'm wondering if I should set the hardware clock to UTC, instead.

Well, if you have the hardware clock set to localtime, and you move it
from EST to MST, you have to change both the hwclock and the zoneinfo
links.  Things will be inconsistent during that change.  That's why it's
recommended to use UTC in the hwclock.  Except when running brain damaged
OSs that keep the clock in local time and don't let you change their
behavior :-)

So, when it's convenient to reset the hwclock through the bios, check and
make sure it is UTC.  Perhaps hwclock --show will tell you the same
thing.

Reading the hwclock manpage, it seems that your problem is your kernel is
in the wrong timezone.  That's why programs like date work (uses your
zoneinfo setting) but your file times are wrong.  The kernel stamps the
file with what it thinks, and then ls interprets that stamp into local
time.  Since the kernel and ls are using different timezones, the stamps
are wrong.

Unfortunately the manpage doesn't say how to get the kernel on the right
time.  Perhaps setting UTC=true in your /etc/sysconfig/clock and
rebooting.

Besides your cron job, there are boot scripts that will set the system
and hardware clocks.  You should check those and make sure they agree
with your cron job.  Perhaps there is something there overriding your
sysconfig/clock file.  The scripts should be together in a directory
under /etc - look for rc.d or init.d or something.

HTH,
Dave





More information about the clue-tech mailing list