My time wont sync with network time

I decided to do a reinstall as well. Sometimes it’s just better. a Clean slate.

If you do it, though, I suggest you take note of what you can do differently, better. And actually do it. Otherwise, it’ll only happen again. And again. As long as you learnt something.

2 Likes

The rtc time changes to the wrong time when checking timedatectl status after turning rtc on.

If possible I would like to fix the problem so that I can fix it if it happens again.

Define wrong time. If you use this option, the RTC Time is the same es the local time.

I asked if the Universal time is correct. You said

But the local time is for the selected timezone correct! If your local time is not correct then you need to use a different timezone.

This has nothing to do with the first problem

but the result will be the same. Only the Universal time is synced, the Local time is calculated.

And in your output the local time is correctly calculated. 10:30 + 5:30 = 16:00 !

I see so the universal time is wrong cause thats what the local time should be!
How do I adjust the universal time then?

Best is:
set RTC(hardwareclock) to Universal Time (at the Moment UTC is)

sudo hwclock --show
[sudo] Passwort für andreas: 
2021-12-10 18:48:05.811536+01:00

while localtime is:

date                                                           
Fr 10. Dez 18:46:43 CET 2021

see@wiki

If you dualboot you have to config this on windows also to: RTC=UTC

https://wiki.manjaro.org/index.php/System_Maintenance#Time_and_Date

https://wiki.archlinux.org/title/System_time#UTC_in_Microsoft_Windows

1 Like

Hey guy thanks for all the help!
Something along the way fixed it, i don’t know when but last night I looked the time its was wrong then after a while after doing some stuff - not related to the problem - I glanced at it again and it was right! :confused:
All I did was mess around with anbox before I noticed it was corrected and I wonder if it had something to do with anbox?
Here is what timedatectl status outputs now:

               Local time: Sat 2021-12-11 08:31:32 IST
           Universal time: Sat 2021-12-11 03:01:32 UTC
                 RTC time: Sat 2021-12-11 14:01:36
                Time zone: Asia/Kolkata (IST, +0530)
System clock synchronized: yes
              NTP service: active
          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'.

and here is what timedatectl show-timesync --all outputs now:

LinkNTPServers=
SystemNTPServers=0.in.pool.ntp.org 1.in.pool.ntp.org 2.in.pool.ntp.org 3.in.pool.ntp.org
FallbackNTPServers=0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org
ServerName=0.in.pool.ntp.org
ServerAddress=165.22.213.178
RootDistanceMaxUSec=5s
PollIntervalMinUSec=32s
PollIntervalMaxUSec=34min 8s
PollIntervalUSec=4min 16s
NTPMessage={ Leap=0, Version=4, Mode=4, Stratum=2, Precision=-24, RootDelay=246.215ms, RootDispersion=39.489ms, Reference=F3327FB6, OriginateTimestamp=Sat 2021-12-11 08:29:11 IST, ReceiveTimestamp=Sat 2021-12-11 08:29:11 IST, TransmitTimestamp=Sat 2021-12-11 08:29:11 IST, DestinationTimestamp=Sat 2021-12-11 08:29:11 IST, Ignored=no PacketCount=35, Jitter=412.224ms }
Frequency=9033747

This is not solved yet !

  • Please read the WARNING !
  • Your RTC is different from Local and Universal
timedatectl status                                             
               Local time: Sa 2021-12-11 07:49:48 CET
           Universal time: Sa 2021-12-11 06:49:48 UTC
                 RTC time: Sa 2021-12-11 06:49:48
                Time zone: Europe/Berlin (CET, +0100)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

(This is like it should look like ! (See, no WARNING))
The ARCH-Wiki suggests to use Universal the same as RTC !
(or otherwise Local same as RTC)

The warning is not a real problem. Since the OP uses a Dualboot, it is either that or the OP needs to edit the Windows registry as described in the Arch Wiki.
However both ways aren’t supported or recommended and can result in issues. It is up to the OP to decide which method it should be.

However, if RTC is set to local, it needs to be this time. Which is apparently not. This needs to be fixed by the OP. A command to set the RTC in local time, requires that the local time from timedatectl status is correct.

hwclock --systohc --localtime

The OP need to run it with sudo or as root.

1 Like

Ok thanks I ran the command with sudo and here is the output from timedatectl status

               Local time: Sat 2021-12-11 21:43:04 IST
           Universal time: Sat 2021-12-11 16:13:04 UTC
                 RTC time: Sat 2021-12-11 21:43:04
                Time zone: Asia/Kolkata (IST, +0530)
System clock synchronized: no
              NTP service: active
          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'.

it worked! :+1:

oh and by the way it is anbox! starting anbox fixes the problem! I don’t know how or why but it is!
After a restart my time was wrong then when I opened anbox it corrected itself.

I sent this reply not noticing my time was wrong again. Then when I noticed that the time was wrong I started anbox and the time changed right before my eyes. and checking timedatectl status

               Local time: Sat 2021-12-11 17:36:02 IST
           Universal time: Sat 2021-12-11 12:06:02 UTC
                 RTC time: Sat 2021-12-11 17:36:02
                Time zone: Asia/Kolkata (IST, +0530)
System clock synchronized: yes
              NTP service: active
          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'.