1

The system is located in Italy, and executing date gives Fri 7 Aug 16:15:56 CEST 2020, whereas the actual time is 14:21:09.

Executing timedatectl status gives:

               Local time: Fri 2020-08-07 16:15:56 CEST
           Universal time: Fri 2020-08-07 14:15:56 UTC 
                 RTC time: Fri 2020-08-07 14:15:57     
                Time zone: Europe/Rome (CEST, +0200)   
System clock synchronized: no                          
              NTP service: inactive                    
          RTC in local TZ: no

How can I fix show the correct time?

Arch is in dual boot with Windows 10 and I don't care if Windows shows the wrong time when I'll have the correct time on Arch.

Enlico
  • 1,555

1 Answers1

6

Although you definately should set-up NTP (ArchWiki has an excellent article on the subject: https://wiki.archlinux.org/index.php/Network_Time_Protocol_daemon#Configuration) you will continue to have problems because Windows assumes that the system clock should be local time and will keep adjusting it. Linux will continue to do it the other way around.

The solution to this is to reconfigure one of them. For example to tell Linux that the system clock is local, you can run this command:

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

The other way around, telling Windows to use UTC can be done by adding this registry entry:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal

Which should be DWORD (32) with a value of:

1
miedema
  • 401
  • 3
  • 9
  • Is your second suggestion dependent on setting up NTP? – Enlico Aug 07 '20 at 12:57
  • No, it will work without NTP, but it's still better to set-up NTP as well. Most computer clocks are not very reliable and if you end up using Linux a lot, it will keep drifting further away. – miedema Aug 07 '20 at 13:03
  • 1
    If you expect to use Linux more, I would suggest to change the Windows registry. If you want to change the time before setting NTP you can use the date command in Linux:

    % sudo date -s "7 AUG 2020 15:05:00"

    – miedema Aug 07 '20 at 13:05
  • +1, and I will use Linux the most. I'll test the effect of changeing the registry on Windows soon enough and accept. – Enlico Aug 07 '20 at 13:20
  • See the general NTP Q&A at https://unix.stackexchange.com/q/91792/5132 for the next part of the problem, which is ntpd refusing to correct errors that large. – JdeBP Aug 07 '20 at 16:34
  • Strangely I've found today again the wrong time, so I've run again the sudo timedatectl set-local-rtc 1 --adjust-system-clock command, and checked that after reboot the time is still fine, so apparentry is something other than the reboot that reset the time to the wrong one. I'll monitor it for some time. – Enlico Aug 09 '20 at 17:57