How can I get linux and windows to agree on correct system time in dual-boot situations?

Commands for achieving system clock balance :-).

How can I get linux and windows to agree on correct system time in dual-boot situations?
Photo by Icons8 Team / Unsplash

This might be an edge-case scenario but I thought I'd post it anyway. Linux and Windows operating systems interpret the hardware clock time on a computer differently:

  • Linux typically assumes that the hardware clock time is in the UTC timezone
  • Windows assumes that the hardware clock time is in the local/regional timezone

Depending on who you ask, you'll get different explanations but the popular rationale (from the Windows perspective) is that setting everything to local time helps with backwards compatibility and to avoid confusion for users if they're adjusting time in BIOS.

In any event, if you do need to alternate between Linux and Windows on the same system, there's one of two approaches here: .

  1. Set BIOS to use local time and have Linux factor this in:

timedatectl set-local-rtc 1 --adjust-system-clock

or

  1. Set BIOS to use UTC time and have Windows function with an offset with this registry key:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
 "RealTimeIsUniversal"=dword:00000001
🚧
Careful. Neither operating system is fully happy with these types of changes. There's a small chance that either OS could complain. Your mileage may vary.

For additional information on the topic, check out these articles:

How to Fix Windows and Linux Showing Different Times When Dual Booting
Your computer stores the time in a hardware clock on its motherboard.
Does Windows 10 support UTC as BIOS time?
EDIT 2015-SEP-30: Seems I actually ended up with localtime enabled in Linux somehow, probably as a consequence of a reinstall some time ago. I switched Linux to UTC and now my configuration seems…
How do I set my clock in Windows to UTC / localtime?
I have a dual boot and a I configured windows to use UTC with a registry fix as explained in here: Clock time is off on dual boot Now, I need to come back to localtime again, and I have no idea ab…