Do you dual-boot Linux and Windows? Have you ever observed that whenever Windows boots, the time is displayed incorrectly? My machine is dual booting Windows 10 and Ubuntu 22.04.1 LTS, and anytime I booted into Windows, the time was always displayed incorrectly whereas Ubuntu was always accurate.
I’ll explain the cause of this problem and how to fix it in this blog.
Summary
- Issue: When dual-booting the computer, time was displayed differently between Linux (correct) and Windows (incorrect)
- Reason: Windows and Linux store their time in the UEFI firmware/BIOS differently
- Solutions: Either set Windows to use UTC or set Linux to use local time
Why Windows shows the wrong time after booting into Ubuntu?
When the OS boots, it refers to the hardware clock on the motherboard of the machine, which stores the time (you can check this time in the UEFI firmware/BIOS). Except from that whereas Windows keeps hardware clocks as local time by default, Linux stores hardware clocks as UTC by default.
Having both UTC and local time as hardware clocks can cause time conflicts when switching from Ubuntu to Windows.
- Hardware clock (also known as the real-time clock or RTC) – stored in the CMOS battery and keeps tracking the time even when a computer is shut down.
- System clock – stored in RAM and maintained by the Linux kernel. When Linux is booted, it reads the hardware clock and then sets the system clock based on that data. The system clock is maintained by UTC.
- UTC – Coordinated Universal Time
The following provides a thorough description of how time is managed in a dual booting scenario using my time zone, America/Toronto (now EDT -4 hours, which is UTC -4 hours) as an example.
- If it is currently 09:08 local time in Toronto. Ubuntu starts at UTC (13:08) and adjusts Daylight Saving Time and time zone differences to show the current local time on the desktop (offset of UTC -4:00 therefore 09:08). The hardware clock is now kept in UTC since Linux keeps it set to UTC.
- Ubuntu is now shut down and rebooted into Windows. When the computer refers to the hardware clock, Windows understands it as the current local time. Because of this, the desktop shows the improper time, which, according to the hardware UTC clock data that Ubuntu previously stored, is 13:08.
- Even if you may have fixed the time conflicts on Windows by modifying the present time by turning on the automatic time setting once more, issues still persist. This is due to the fact that Windows and Ubuntu are booted alternately.
Let’s check the information provided above in the terminal.
Enter the following into the terminal to access the system’s current time and date information:
timedatectl

- UTC = 13:08
- Local time = 09:08 (Eastern Daylight Time adjusted)
- System clock synchronized: yes = time is successfully synced
- NTP service: active = timesyncd is up and running
- RTC in local TZ: no = hardware clock is using UTC instead of local time
How to fix the time conflicts
You have two options for resolving this problem:
- Make Windows use UTC
- Make Linux use local time
I will only demonstrate the second method of configuring Linux to use local time in this blog because I felt it was safer and simpler than changing the Windows configuration. The use of local time as a hardware clock in Linux, however, may cause issues with time zone transitions and DST adjustments. Consider configuring Windows to utilize UTC if you are running time-sensitive software. I suggest reading this article from Arch Linux if you like to configure Windows to use UTC.
Although daylight saving time is in effect in my area, I am setting Linux to use local time because I do not currently run any time-sensitive applications and I have not yet discovered any problems.
- Step 1
- Step 2Set Linux to use local time
Now, use the command below to set Linux to save the hardware clock’s time as local time:
timedatectl set-local-rtc 1 --adjust-system-clock
and then type the following again to be sure the change was made:
timedatectl
[Terminal – timedatectl set-local-rtc 1 –adjust-system-clock & timedatectl] - RTC in local TZ: yes = hardware clock is using the local time
Additionally, you can confirm using the hwclock command listed below:
sudo hwclock -r --verbose
[Terminal – sudo hwclock -r –verbose] As shown above, Linux is now using local time as a hardware clock.
- Step 3Boot into Windows and re-enable automatic time
As Windows boots up, you may see that the time has not yet been corrected and is still shown incorrectly. It is expected.
Once Linux has been configured to utilize local time, you should shut down Linux and start Windows. All you need to do is turn on the automatic timer again (you only need to do this once).
Go to Start > Settings > Time & language > Date & time (or just click the clock in the lower right corner of your screen and select Adjust date/time from the pop-up menu that appears). Then turn the automatic time set from on to off and back to on.
[Adjust date/time] [Settings>Time & Language>Date & time>Set time automatically] When you enable automatic time again, Windows will begin to collect the accurate time data and show the accurate time going forward.
How to revert the change – Setting Linux to use UTC as a hardware clock
Use the following command in the Linux terminal to undo the modification and return UTC to being used as the hardware clock. Windows does not require any changes.
timedatectl set-local-rtc 0 --adjust-system-clock
Then verify the change with either command:
timedatectl
“RTC in local TZ: no”
sudo hwclock -r --verbose

Comments