• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Clock gets set wrong every time I boot into another OS

Red Squirrel

No Lifer
Every time I boot into Windows, the time will be wrong, then when I boot back in Linux it will be WAY wrong. Like several hours. i googled this and it seems to be a common bug with the way Linux handles time. It's telling me to edit /etc/conf.d/clock but I don't have /etc/conf.d. What do I do? I'm using Xubuntu.

Also is this a bug in Linux, or in Windows? Is there something in Windows I can do to fix it?
 
The easy fix for this is to use NTP[1,2]. Install the ntp package on the Linux side and that will correct the time for you. Read [3] for basic set up and info.

The default /etc/ntp.conf should work just fine, but if you want comment out the default servers and use ones closer to your region. Like:

Code:
server 0.us.pool.ntp.org iburst
server 1.us.pool.ntp.org iburst
server 2.us.pool.ntp.org iburst
server 3.us.pool.ntp.org iburst

[1] http://www.ntp.org/
[2] http://www.pool.ntp.org/en/
[3] http://www.computerbob.com/guides/guide_using_ntp_on_a_debian_pc.php

There is probably something similar for windows, so you don't have to manually need to update the clock every time you boot into it.

No dual booting here, so no idea on the cause.
 
Last edited:
It's not a bug, but a difference in how Windows and Linux store time in the BIOS.

Linux (and every other operating system on the planet not named Windows) stores BIOS time in UTC, and uses time zone offsets to convert to your local time. Windows stores BIOS time in your local time directly.

To resolve this, see here: https://help.ubuntu.com/community/UbuntuTime#Multiple_Boot_Systems_Time_Conflicts

Thanks for the info, good to know these things. Would still use NTP tho.
 
I have NTP, so the problem does eventually fix itself. So it's basically Windows doing it wrong then? I'll try that reg patch in the link to see if it fixes it.
 
I doubt the Windows registry change helps; at least it did not reliably stay in UTC.

Motherboard has a hardware clock -- hwclock. When OS starts, it gets time from the hwclock. Then it keeps time in software. When OS shuts down, it writes the software time back to hwclock. It is assumed that the hwclock is not as reliable than software. NTP adjusts the software clock during runtime in order to keep it "in time" with "reliable timesource". That is good.

Make the Xubuntu to assume that hwclock has local time. It will work fine with that assumption and it will update the hwclock to what Windows expects, when you reboot.
 
I had this same problem with Lubuntu, but only on Dell computers.

I "fixed" the problem by setting the NTP timezone to Africa/Algeria. LoL! 😀
 
You have to set the timezone info too, but using bogus timezone to compensate for erroneous clock is not the correct method.


Off Topic anecdote: Once upon a time there was a program called "MS Word". This program did offer "shortcut keys". For example, "Ctrl+Alt+2" applied a paragraph style. On some locales, the keyboard layout contains "AltGr" modifier instead of "Right Alt". "Alt Gr" generates essentially "Ctrl+Alt". "AltGr+2" were supposed to create the @-sign, useful for typing an email address. Obviously, the Word shortcut overruled that.

What was the frequently proposed solution? Define in Word a "user defined shortcut" -- "Ctrl+Alt+2" to run command "Insert symbol '@'". That did override Word's default shorcut, which in turn did override the default of the keyboard: "@". That did appear to restore original function, but was slow. The better method (no, I don't say "banish Word") was to simply remove the default shortcut.

Moral of the story: keep hwclock in local time and set timezone correctly. Then pray that Daylight Saving Time shenanigan does't ruin your day.
 
Every time I boot into Windows, the time will be wrong, then when I boot back in Linux it will be WAY wrong. Like several hours. i googled this and it seems to be a common bug with the way Linux handles time. It's telling me to edit /etc/conf.d/clock but I don't have /etc/conf.d. What do I do? I'm using Xubuntu.

Also is this a bug in Linux, or in Windows? Is there something in Windows I can do to fix it?

I have had the same problem and came up with this script to run at windows startup.
Code:
net start w32time 
ping 192.168.1.1 -n 1 -w 6000 >NUL
w32tm /resync
 
Seems to have worked to tell Linux to keep local time. Now hopefully daylight saving time does not mess that up. Are we offset now, or is that in winter? I always forget.
 
Back
Top