I have no ideas how to fix this. In my /etc/TIMEZONE file the TZ variable has the correct value (Canada/Eastern) and still it's showing a -1 hour lag. Where else should I be looking?
That is the correct file to edit. The only other step required is a reboot. The reason a reboot is required is that the init
process reads the value of TZ when it is started, and all other processes inherit this value. As far as I know, there is no way to make the change effective without doing a full reboot.
Also, make sure /etc/TIMEZONE
is symlinked to /etc/default/init
. For example:
[root@server:/etc]ls -l /etc/ | grep TIMEZONE
lrwxrwxrwx 1 root root 14 Jul 7 2008 TIMEZONE -> ./default/init
Is your machine patched up-to-date? There were changes in DST handling for North America in 2007. On my Solaris 10 I have:
-bash-3.00$ ls -l /usr/share/lib/zoneinfo/Canada/Eastern -rw-r--r-- 2 root bin 1252 Jul 14 2008 /usr/share/lib/zoneinfo/Canada/Eastern -bash-3.00$ openssl md5 /usr/share/lib/zoneinfo/Canada/Eastern MD5(/usr/share/lib/zoneinfo/Canada/Eastern)= 82980b1345aab5a97d90307edfefb6da
Do you use NTP to set the time automatically or do you do it manually?
Volker
When you actually log into the host, what timezone is set in your shell session?
If the timezone in your shell session doesn't match /etc/TIMEZONE, then you probably need to reboot for the timezone change to take effect.
If the timezone in your shell session is correct, but the actual time is wrong, then either the system clock is off or the timezone definition file is wrong somehow. You can run "date -u" to get the UTC time, which will help you figure out if the actual clock is wrong.
You should check what your hardware clock is. I would suggest doing this:
- Set the UTC time correctly. i.e. (5 AM in the example):
$ date -u -s "05:00"
Thursday, April 29, 2010 05:00:00 AM UTC
- Set the hardware clock accordingly (tod for SPARC and rtc for x86):
$ rtc -c (the '-c' argument sets the DST correctly)
- Check the date again:
$ date
Thursday, April 29, 2010 02:00:11 AM ART
Regards,
Leandro.