Skip to content

How to prevent Linux to change the system clock time, in dual boot configurations

When running Windows on a multi-boot configuration system, it might happen that after a Linux session, Windows displays an incorrect time. It will show the exact minutes and seconds, but there will be a noticeable difference in hours.

This is because, by default, Linux assumes that the machine clock is set to UTC, whereas Windows uses the local time. So, when Linux booted, it assumed the clock was or should have been in UTC mode and synchronized it with the time servers using this default time zone, changing the machine time. Later, when Windows booted, it simply used the machine’s time as local time, displaying the wrong hour.

To correct this situation, an adjustment is needed either on Linux or on Windows.

A quick way to fix that is to boot into Linux and change its default behaviour by running this command:

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

This will tell Linux to start using the local time instead of UTC.

This is it. Reboot your system into Windows, synchronize time to ensure your clock is correct, and enjoy!

If, for any reason, you need to reset Linux to its initial UTC mode, you will have to run the following command:

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

The above scenario occurs when Linux is set in UTC mode, and Windows’ time configuration does not use UTC. These default configurations on Linux and Windows systems must be adjusted to work correctly after installation.

Another option would be to modify Windows to consider the system time as UTC. In this case, no adjustment is needed on Linux, but using regedit.exe, the Windows registry editor, the following steps must be followed:

  1. Open regedit and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation.
  2. Check for RealTimeIsUniversal key.
  3. If it exists, ensure that its value is set to 1.
  4. If it does not exist, then create a new key named RealTimeIsUniversal of DWORD type.
  5. Set its value to 1.
  6. Close regedit. After reboot, Windows will show the right time, assuming its time zone is set correctly.