[H-GEN] Wrong time.

Paul Gearon gearon at computer.org
Wed Apr 12 09:16:38 EDT 2000

[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics.  Please observe the list's charter.          ]

Jason McDonald wrote:
> Looks like your system clock is set to GMT instead of local time.  I know
> how to fix it in SuSE, but not in Red Hat.  There should be a way to tell
> linux to interpret the system time as GMT and adjust it to the configured
> timezone.

Jason, Frank and Mike are all correct.  It's a pretty typical problem. 
Personally, it makes more sense to set the hardware clock to UTC, but
other OS's (if we can call them that) don't understand this.  It's
particularly an issue if you want to dual boot.  If that's the case then
you need the hardware clock set to local time.

Reading the man page for hwclock is the way to go.  Type "man hwclock". 
This will let you set the time on your system from your hardware clock,
or let you set the hardware clock from the system time.

However, this will only work until you reboot.  For x86 RedHat you'll
find the relevant configuration in the file "/etc/sysconfig/clock". 
This is read and used by the file "/etc/rc.d/rc.sysinit".  I assume that
these are the same files in the PPC.

The file you want to change is /etc/sysconfig/clock (you need root
permission to change it).  It currently has a line saying:
... or maybe:

(depending on whether you are 10 hours ahead, or 10 hours behind)

Change it to the other setting and your time should stay correct after
the next reboot.

If you know what you are doing, and you are curious to see how it's all
set up, then I recommend reading /etc/rc.d/rc.sysinit.  This will show
you how it reads the /etc/sysconfig/clock configuration file, and how it
makes use of it with the hwclock program.  The mess you find in
/etc/rc.d/rc.sysinit is yet another good reason why people choose Debian
over RedHat  :o)

(Nooks, are you listening?)  ;-)


Paul Gearon
gearon at computer.org

Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum
immane mittam.
(Translation from latin: "I have a catapult. Give me all the money,
or I will fling an enormous rock at your head.")

* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.

More information about the General mailing list