Fedora Linux Support Community & Resources Center
Old 27th March 2012, 11:00 AM
old486whizz Offline
Registered User
Join Date: Jan 2008
Posts: 34
hwclock rewinding time on boot? (F15)

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:
[ 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.
Reply With Quote
Old 27th March 2012, 03:55 PM
Gareth Jones Offline
Retired Adminstrator
Join Date: Jul 2011
Location: Birmingham, UK
Age: 34
Posts: 2,761
Re: hwclock rewinding time on boot? (F15)

Run system-config-date and check that everything is reasonable. Also see this thread: http://forums.fedoraforum.org/showthread.php?t=277957, which sounds like it might be a similar problem.

Last edited by Gareth Jones; 27th March 2012 at 03:55 PM. Reason: Fixed wrong command...
Reply With Quote
Old 12th April 2012, 01:32 PM
old486whizz Offline
Registered User
Join Date: Jan 2008
Posts: 34
Re: hwclock rewinding time on boot? (F15)

Thanks for the reply.
I found a bugzilla bug against this and after reading through it thought it would be far more easier if I just set the BIOS to UTC (since that then fixed the issue at hand).

The bugzilla said it was not a fault (which has got to be incorrect, since the binary clearly keeps moving the time back by an hour) - but it did point me to a useful link.

So now, /etc/adjtime contains "UTC", the BIOS is in UTC time, and all is well with the world.

I just had to go into Windows and set it to store the time in UTC in the BIOS and viola!
... I feel dirty every time I boot into Windows on it.
Reply With Quote

boot, f15, hwclock, rewinding, time

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help with hwclock mk27 Using Fedora 2 19th March 2009 05:11 AM
hwclock setting time 19 days ago cmap Using Fedora 1 14th April 2008 06:07 PM
Fedora 8 dual boot with Windows XP [Pavilion dv6137tx] Time gets reset every time! maverick280857 Hardware & Laptops 5 23rd March 2008 11:48 AM
hwclock losing time avchan Using Fedora 1 5th October 2005 04:54 PM
Time/HWClock & Issues w/ Software KeDruff Using Fedora 1 23rd January 2005 03:35 AM

Current GMT-time: 13:27 (Tuesday, 19-09-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat