How can I get linux and windows to agree on correct system time in dual-boot situations?
Commands for achieving system clock balance :-).
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: .
- Set BIOS to use local time and have Linux factor this in:
timedatectl set-local-rtc 1 --adjust-system-clock
or
- 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
For additional information on the topic, check out these articles: