Linux & Open SourceTechnology

Clock Off by 5 Hours in Dual Boot? Fix Windows and Ubuntu Time Once and For All

Admin
Clock Off by 5 Hours in Dual Boot? Fix Windows and Ubuntu Time Once and For All

You boot into Ubuntu and the time is correct. Then you restart into Windows 11, and the clock is five hours ahead or behind. You fix it in Windows, go back to Ubuntu, and now Ubuntu is wrong. This back-and-forth clock problem affects almost every dual boot user at some point.

The good news is that nothing is broken. Windows and Ubuntu simply read your computer’s hardware clock in two different ways. Once you make them agree on one method, the time stays correct in both systems forever.

Quick Answer

Windows uses local time for the hardware clock, while Ubuntu uses UTC. The easiest fix is to make Windows use UTC by adding a registry value called RealTimeIsUniversal set to 1 under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation. Alternatively, run timedatectl set-local-rtc 1 in Ubuntu to make Ubuntu use local time. Pick one method — the Windows registry fix is recommended.

Why the Clock Is Wrong by 5 Hours

Inside your computer there is a small battery-powered chip called the RTC, or Real-Time Clock. It keeps time even when the PC is off. Every operating system reads this clock at boot, but they interpret the stored value differently.

How Ubuntu Reads the Clock

Ubuntu and most Linux systems assume the hardware clock stores UTC, which is Coordinated Universal Time. When Ubuntu boots, it reads the UTC value and then adds or subtracts your timezone offset to show local time. If you live in Pakistan, for example, local time is UTC+5, so Ubuntu adds five hours.

How Windows Reads the Clock

Windows assumes the hardware clock already stores local time. It reads the value exactly as it is and displays it without conversion.

What Goes Wrong in Dual Boot

Imagine the real time is 3:00 PM in a UTC+5 timezone, which is 10:00 AM UTC. Ubuntu stores 10:00 in the hardware clock because it uses UTC. Windows boots next, reads 10:00, assumes it is local time, and displays 10:00 AM — five hours behind. Then Windows syncs or you correct it to 3:00 PM and stores 3:00. Ubuntu boots, reads 3:00, treats it as UTC, adds five hours, and displays 8:00 PM — five hours ahead.

That is why the error is exactly your timezone offset — five hours for Pakistan, five and a half for India, and so on.

Check Your Current Settings in Ubuntu

Before changing anything, check how Ubuntu is currently set. Open a terminal and run:

timedatectl

You will see output similar to this:

  • Local time — your current displayed time
  • Universal time — current UTC time
  • RTC time — what is stored in the hardware clock
  • Time zone — your selected timezone
  • A line saying whether the RTC is in local TZ or not

If it says “RTC in local TZ: no”, Ubuntu is using UTC mode, which is the Linux standard. Make a note of this before you decide which fix to apply.

You can learn more about how systemd manages time in the official timedatectl manual page.

Method 1: Make Windows Use UTC (Recommended)

This is the best long-term fix. Linux, macOS, and most servers use UTC, so bringing Windows in line avoids side effects. It also handles daylight saving changes more cleanly.

  1. Boot into Windows 11.
  2. Press Win + R, type regedit, and press Enter to open Registry Editor.
  3. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation.
  4. Right-click in the empty area on the right, choose New, then DWORD (32-bit) Value — even on a 64-bit system, choose 32-bit.
  5. Name it exactly: RealTimeIsUniversal
  6. Double-click it and set the value to 1.
  7. Close Registry Editor.
  8. Go to Settings, then Time & Language, then Date & Time. Turn “Set time automatically” off and back on to force a sync.
  9. Restart into Ubuntu and check the time. Then restart back into Windows and check again. Both should now be correct.

If you prefer a command instead, open Command Prompt as Administrator in Windows and run:

reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal /d 1 /t REG_DWORD /f

After this change, also disable the Windows Time service conflict by making sure internet time sync is on in both systems. Both will now write UTC to the hardware clock, so no conversion fight happens.

How to Undo This Change

If you ever stop dual booting and want Windows back to default, delete the RealTimeIsUniversal value in Registry Editor, or set it to 0, then let Windows sync the time once.

Method 2: Make Ubuntu Use Local Time

If you do not want to edit the Windows registry — for example on a work laptop — you can change Ubuntu instead. This is quicker but slightly less ideal, because Ubuntu will then behave like Windows and may drift around daylight saving changes.

  1. Boot into Ubuntu 24.04.
  2. Open a terminal with Ctrl + Alt + T.
  3. Run: timedatectl set-local-rtc 1 --adjust-system-clock
  4. Check with timedatectl — it should now say “RTC in local TZ: yes”.
  5. Restart into Windows and confirm the time is correct there too.

You may see a warning that local RTC mode is not fully supported. That warning is normal for this setup and most home users never have a problem with it.

To reverse this later, run: timedatectl set-local-rtc 0 --adjust-system-clock

Only use one method. Do not apply both Method 1 and Method 2 at the same time, or the mismatch will return in the opposite direction.

If you regularly maintain your system from the command line, our walkthrough on how to update Ubuntu from the terminal shows how timedatectl fits into normal Ubuntu upkeep.

Method 3: Force a Time Sync in Both Systems

Sometimes the offset method is already consistent, but one system has simply drifted or failed to sync after travel or a dead CMOS battery. In that case, force a sync.

Sync Time in Ubuntu

  1. Check sync status: timedatectl status
  2. Make sure “System clock synchronized: yes” and NTP service is active.
  3. If not, enable it: sudo timedatectl set-ntp true
  4. Restart the time service: sudo systemctl restart systemd-timesyncd
  5. Wait a few seconds and check timedatectl again.

Sync Time in Windows

  1. Open Settings, then Time & Language, then Date & Time.
  2. Confirm your timezone is correct.
  3. Click “Sync now” under Additional settings.
  4. If sync fails, open Services, find Windows Time, and set it to Automatic.

The Arch Wiki system time guide gives an excellent technical explanation of UTC versus local time if you want a deeper understanding.

Special Cases: 5 Hours, 5:30, and Other Offsets

The size of the error always matches your timezone offset from UTC. A five-hour difference points to a UTC+5 or UTC-5 location. A five-and-a-half-hour difference points to India or Sri Lanka at UTC+5:30. If your error is not a clean timezone offset — for example 7 minutes or 2 hours and 13 minutes — the cause is more likely a failing CMOS battery, a wrong timezone selection, or a system that has not synced online for a long time.

Also check that both systems have the same timezone selected. Windows might be set to one city while Ubuntu is set to another. Even with the RTC fix applied, mismatched timezone settings will still show different times.

Common Mistakes and Useful Tips

  • Applying both fixes: Making Windows use UTC and Ubuntu use local time at the same time recreates the problem. Choose only one side to change.
  • Creating a 64-bit DWORD: The registry value must be DWORD (32-bit) even on 64-bit Windows. A QWORD value will be ignored.
  • Spelling the value wrong: The name must be exactly RealTimeIsUniversal with no spaces. Windows ignores a misspelled entry silently.
  • Manually fixing the clock every boot: Dragging the time to the correct value without fixing the RTC mode just rewrites the wrong format again. It will break on the next switch.
  • Tip: After applying a fix, boot back and forth twice and check the time each time. One correct boot can happen by luck after an internet sync; two in a row proves the fix works.
  • Tip: If your PC is old and loses time when unplugged for days, replace the small CR2032 CMOS battery on the motherboard.

Conclusion

The five-hour clock shift between Windows and Ubuntu 24.04 is not a bug in either system — it is a simple disagreement about what the hardware clock stores. Make Windows use UTC with the RealTimeIsUniversal registry value, or make Ubuntu use local time with timedatectl set-local-rtc 1. Apply just one of these fixes, sync the time once, and your clock will stay correct no matter how often you switch between the two systems.

Frequently Asked Questions

Which fix is better, changing Windows or changing Ubuntu?

Changing Windows to use UTC is recommended because UTC is the standard used by Linux, macOS, and servers. It handles timezone and daylight saving changes more reliably and avoids warnings in Ubuntu.

Why is my time off by exactly 5 hours and 30 minutes?

That offset matches the UTC+5:30 timezone used in India. It confirms the same RTC mismatch — one system stores UTC and the other expects local time. The same fixes apply.

Will the registry edit harm Windows?

No. RealTimeIsUniversal is a documented Windows setting used on many dual boot and server systems. You can undo it at any time by deleting the value or setting it to 0.

My time still changes after I applied the fix. What now?

Check that you did not apply both methods, confirm both systems use the same timezone, and make sure automatic time sync is enabled in both. Also test with a full shutdown instead of Fast Startup, which can restore old clock state.

Does this problem affect virtual machines too?

It can. A Windows guest inside a Linux host may show wrong time if the virtual hardware clock setting does not match the guest expectation. The same UTC registry fix inside the Windows guest usually resolves it.

Admin

Passionate about the intersection of style and storytelling. I simplify fashion trends and industry news into easy-to-follow advice, helping you stay stylish and informed in the fast-paced world of fashion.

Leave a Reply

Your email address will not be published. Required fields are marked *