How to correct most common cause of incorrect time in dual boot (w/Windows) systems

Tags: #<Tag:0x00007fe32ed29268> #<Tag:0x00007fe32ed29178> #<Tag:0x00007fe32ed290b0> #<Tag:0x00007fe32ed28fe8>

To simplify this whole deal:

If you have an incorrect time issue in Linux on a dual boot with Windows system do this:

Check your Linux system:

$ timedatectl
                      Local time: Tue 2018-08-21 13:11:23 CDT
                  Universal time: Tue 2018-08-21 18:11:23 UTC
                        RTC time: Tue 2018-08-21 18:11:23
                       Time zone: US/Central (CDT, -0500)
       System clock synchronized: no
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

We are concerned about that last line only. If it says ‘RTC in local TZ: yes’ then you are set correctly and there is some other problem. But more than likely you will see just what I have posted and RTC in local TZ is set to no. To correct:

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

You will be asked for root/administrator password, enter that and the command will run. Then to check run ‘timedatectl’ again and you should see:

$ timedatectl
                      Local time: Tue 2018-08-21 18:15:28 CDT
                  Universal time: Tue 2018-08-21 23:15:28 UTC
                        RTC time: Tue 2018-08-21 18:15:28
                       Time zone: US/Central (CDT, -0500)
       System clock synchronized: no
systemd-timesyncd.service active: yes
                 RTC in local TZ: yes

Warning: The system is configured to read the RTC time in the local time zone.
         This mode cannot be fully supported. It will create various problems
         with time zone changes and daylight saving time adjustments. The RTC
         time is never updated, it relies on external facilities to maintain it.
         If at all possible, use RTC in UTC by calling
         'timedatectl set-local-rtc 0'.

That is what you want. You’re done. That’s it that’s all there is to correcting this. (That warning is just something we have to live with in order to work with the inferior operating system).

Post-edit: This is of course assuming you already have correct time in Windows. If not, correct that and then go back to your Linux system and repeat the above steps.

4 Likes

If anyone requires a little more explanation I’ll try.

There are 2 clocks in computer operating systems. The system or desktop clock and the hardware clock. When you see the time displayed on OM Lx 3 Plasma5 desktop in menu panel that is the system clock. For this issue we are interested in getting the hardware clock in Linux and Windows to work together. The easiest way to get this to happen is to change the Linux hardware clock.

The issue is caused by Windows setting the computer hardware clock (RTC) to local TZ whereas Linux systems set hardware clock to UTC. So for dual boot, Windows/Linux set ups we need to adjust the Linux hardware clock to local TZ.

My post above address this issue.

I’ll grant that there is more to time and date issues on computers tan this but I believe this is enough for most average users. Anyone who wishes to know more can do an Internet search and read as long as they wish. On the Linux side I recommend the Arch wiki and Fedora documentation. On the Windows side I don’t make specific recommendations but again Internet search and you should be good to go.

Definitions:

RTC = Real Time Clock also called hardware clock or hwclock
TZ = Time Zone

2 Likes