Fix Dual-Boot Clock Mismatch Between Windows and Ubuntu
Iwan Efendi2 min
Fix the clock jumping hours when switching between Windows and Ubuntu by making both OS read hardware RTC as UTC.
If you dual-boot Windows and Ubuntu, you've almost certainly seen this: the clock in Windows suddenly jumps several hours forward or backward right after booting from Ubuntu. It's not a bug — it's a fundamental disagreement between the two operating systems about how to read time from your motherboard.
I spent an embarrassing amount of time thinking my BIOS battery was dying before I realized the actual cause.
The problem comes down to how each OS interprets the RTC (Real-Time Clock) — the hardware clock on your motherboard.
Open PowerShell as Administrator (Win + X → Terminal (Admin)):
You should see If
Boot into Ubuntu and enable NTP sync:
Verify with:
The output you're looking for:
The critical line is
You can set up either OS first. The fixes are independent of each other. What matters is that both are configured — if you only fix one side, the clock drift will come back every time you switch.
After both sides are set, the clock stays consistent no matter how often you switch between operating systems. No more manual time corrections. If you're setting up a dual-boot with a fresh Windows install, it's worth doing this right from the start — it's a two-minute fix that saves a lot of minor annoyance.
The Root Cause
- Windows reads RTC as local time (e.g. UTC+7 for WIB)
- Ubuntu/Linux reads RTC as UTC, then converts to local time in software
Fix: Windows Side (Registry)
1
Add the RealTimeIsUniversal registry key
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal /t REG_DWORD /d 1 /f2
Verify the registry entry
reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal0x1 in the output. That confirms Windows will now treat the hardware clock as UTC.3
Force NTP time sync
net start "Windows Time"
w32tm /config /manualpeerlist:"time.windows.com" /syncfromflags:manual /reliable:YES /update
w32tm /resync /forcew32tm /resync fails with "no time data was available", make sure the /config command ran first — the order matters.4
Restart Windows
A reboot is required for the registry change to take full effect.Fix: Ubuntu Side (NTP)
sudo timedatectl set-ntp truetimedatectl statusSystem clock synchronized: yes
NTP service: active
RTC in local TZ: no
RTC in local TZ: no — that confirms Ubuntu is reading the hardware clock as UTC, which is the correct default.
Order Doesn't Matter
Quick Reference
| OS | Action |
|---|---|
| Windows | Add RealTimeIsUniversal=1 registry key + NTP sync |
| Ubuntu | Enable NTP + confirm RTC in local TZ: no |
After both sides are set, the clock stays consistent no matter how often you switch between operating systems. No more manual time corrections. If you're setting up a dual-boot with a fresh Windows install, it's worth doing this right from the start — it's a two-minute fix that saves a lot of minor annoyance.
References
Topics
Topics in this note
Explore related ideas through the topics connected to this note.
Share this article
Discussion
Preparing the comments area...