April 18, 2021

231 words 2 mins read

HowTo - fix time problem on dual boot systems

HowTo - fix time problem on dual boot systems

You have a dual boot environment with Windows and Linux and after booting to Linux, Windows time is invalid? Don’t worry, there is an easy fix for your problem.

On my home PC I have Windows 10 and Ubuntu 20.10 installed in parallel. After some time I noticed, that each time when I boot to Windows after using Ubuntu, the time in Windows is 2 hours behind actual time.

After investigating this problem, I found the reason. Both Windows and Linux get time from hardware clock - RTC (realtime clock). Operating system reads RTC time on boot. If user or system changes the time, new value is provided to RTC by the operating system.

The problem is that Windows assumes, that RTC time is local time, while Linux assumes, that it is UTC time. So, each time I use Ubuntu, it sets current UTC time to RTC (2 hours behind my local time, as I’m in UTC+2 time zone). Then, Windows boots, reads RTC time and displays it as is - after that I see in Windows, that the time is 2 hours behind actual time.

The simplest fix for this problem is to make Ubuntu assume RTC time is local time. Just type the following command in Ubuntu terminal:

sudo timedatectl set-local-rtc 1

That’s it! After next reboot Windows time will not be broken anymore.


Image credits: