How to Fix Linux and Windows Showing Different Times When Dual Booting

Fix the time offset when dual-booting Linux and Windows.

How to Fix Linux and Windows Showing Different Times When Dual Booting
Time gif from Giphy

Yesterday I stayed up way too long playing around with TrueNAS Scale. My clock on Windows was 1 hour off. So it was 03:30 instead of 2:30 which my body never gets when I am doing interesting stuff.

This happened because I have Windows on one SSD and Linux on the other. Windows assumes that the time stored in the BIOS/UEFI is local time.
Most Linux distros will save the time to the hardware clock in UTC and will do the offset for your time zone somewhere else. So after starting Linux and then starting Windows again you are 1 hour off in Windows.

Solution

The best solution is to configure your distro to save the time in local time instead of UTC.

Most systemd based distros will have the timedatectl available to set things right:

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

Now your Linux box will save the time in local time and windows will not get confused. This works perfectly fine on elementary OS so I guess every Ubuntu-based distro should be fine as well.

You can do something similar in Windows as well but that requires registry edits as far as I know and meh. Also, you have to deactivate the clock sync.

Just go with the fix in Linux and you are set.

Have a great day!