Heya guys,
I haven't come across this before, and a search in the forum only turns up this result:
http://forums.fedoraforum.org/showthread.php?t=39906 .
I've also searched google but can only find man pages and information about setting my timezone (which is set).
SO, let's describe the problem:
I had to boot my laptop today, booted up and noticed the time had gone back by 1 hour on my desktop taskbar.
I assumed it was some NTP problem and ignored it.
After another stop/start of my server, I noticed the time had gone back yet another hour - and so was 2 hours out of sync.
So I started investigating by setting my BIOS time to the local time (UTC+1, which is BST).
I then booted into single-user mode, to make sure there was no network or strange service interference.
So, if UTC is 09:32::
In dmesg I see this:
Code:
[ 0.431101] Time: 10:32:13 Date: 27/03/2012
So the kernel is picking up the time from the BIOS just fine...
After the terminal comes up, then I get:
# date
Tue Mar 27 09:33:56 BST 2012
# date -u
Tue Mar 27 08:33:57 UTC 2012
... Why does it think UTC is 1 hour behind?
I looked at systemctl, and found that hwclock is being called with the "--systz" parameter, which acts slightly different to the "--hctosys" one (eg, doesn't go off to the hardware all the time).
# hwclock -r
Tue Mar 27 10:34:24 BST 2012
# hwclock -u
Tue Mar 27 11:34:33 UTC 2012
Now I understand this! The BIOS is in local time (UTC+1), so hwclock -r would be 'right'.
But even if I set my local clock to be UTC (09:30) the time will just continue to go backwards!!
So, time for the final test to show it is indeed hwclock --systz doing this:
# hwclock --systz
# date -u
Tue Mar 27 09:34:24 UTC 2012
# hwclock --systz
# date -u
Tue Mar 27 08:34:24 UTC 2012
So, I check my timezone data:
# md5sum /etc/local* /usr/share/zoneinfo/GB*
All output's return the SAME checksum - so the files are identical.
So, it seems like hwclock is doing
something strange with the timezone, thinking the time it's getting is local-time, then trying to set the date with the UTC time (but without specifying it's UTC time).
After running a quick strace on the command I've seen it touches /etc/adjtime (I haven't any knowledge on that file yet) so I will start investigating that.
... But, "hwclock -s" set's the time correctly - directly from the BIOS.
... Can anyone offer words of wisdom?
There isn't a BIOS option for UTC that I can see.