I've been having this strange issue with my system clock. Sometimes when I start up Windows 10, my clock displays a time that is 5 hours ahead of the current time. So if it's noon where I live (Eastern time zone), the clock says 5pm. It adjusts for Daylight Savings Time as well staying 5 hours ahead.

I've checked my time zone settings and it's set to the correct time zone. I have internet time set to sync with time.nist.gov, and when manually synchronizing the time, it correctly sets the clock, although the following error message appears when doing so:

"An error occurred while Windows was synchronizing with time.nist.gov. This operation returned because the timeout period expired."

This issue started immediately after erasing my hard drive and reinstalling Windows 10 from scratch, so it's not caused by anything I've installed since then. It only happens on Windows startup, but not every time. I currently have Ubuntu 16.04 installed in a dual boot configuration (the problem started before I installed Ubuntu), and I haven't seen any similar issues with the Ubuntu clock.

I've looked through similar time-related issues on the internet, but none seemed to match mine. This question is very similar to my own, but the issue there was caused by the hardware clock being off, and the clock shown in BIOS on my computer is set to the correct time.

What strikes me as strange is that the time is exactly five hours off, not a minute more, even adjusting for DST. It would seem to me that Windows is occasionally syncing with the wrong time zone, but I have no idea how to verify or correct that.

UPDATE: It turns out that switching from Ubuntu to Windows triggers the 5 hour offset every time, so it was indeed an issue with the hardware clock being set to Universal/Local by Ubuntu/Windows, respectively.

1 Answer
1

I would highly suspect Ubuntu and Windows disagreeing on whether the hwclock is localtime or UTC. The conflict usually comes about because Linux uses the the hwclock set in UTC, while Windows uses the hwclock set to the localtime zone.

If you want your hwclock to show the time in your timezone, then you will need to change linux to not be UTC, which means make linux use localtime. If you are OK with your hwclock (BIOS) to be in UTC, then change windows to be UTC.

Note: Windows Time service will still write local time to the RTC regardless of the registry setting above on shutdown, so it is handy to disable Windows Time service with this command (if time sync is still required while in Windows use any third-party time sync solution):

sc config w32time start= disabled

Reversing the change.

You can create a file with the following contents and then double-click it to merge in the original changes, as above:

I'll try that out. My BIOS clock displays the real time, so I should use the directions under "Reversing the change", right? Also, I'm guessing the - character in that section ("RealTimeIsUniversal"=-) is supposed to be a 0.
– OceanBagelMar 13 '17 at 0:56

If you want your hwclock to show the time in your timezone, then you will need to change linux to not be utc, which means make linux use localtime. If you are OK with your hwclock (BIOS) to be in UTC, then change windows to be UTC. The reversing instructions are simply to undo making windows use utc.
– Stephen RauchMar 13 '17 at 1:00

1

Ok, now I understand. Switching back and forth from Ubuntu to Windows does indeed trigger this 5 hour offset every time. I've made it so Windows reads the clock as UTC, and it seems to fix it.
– OceanBagelMar 13 '17 at 1:26