You are not logged in.

#1 2024-04-04 08:43:04

joanmanel
Member
Registered: 2012-11-06
Posts: 234

Wrong time since the time changed this weekend

Hi,

This is a laptop I have had for a couple of years. it dual boots with windows, and I never had this problem before.

For perspective, it currently says as time 10:11am, which is completely wrong because I am at 09:37am. No idea where it is getting those wrong values from. Prior to this weekend I had it automated, set to UTC (same in Windows, also UTC and Automated) and it all seemed to work fine. For some reason windows cannot sync now (but that's another problem).

I've tried setting it manually, but then once I boot back from windows, it is wrong. I tried to do it automatically, but as you can see the time is all wrong.

[juanma@latitude ~]$ timedatectl 
               Local time: Thu 2024-04-04 10:12:53 BST
           Universal time: Thu 2024-04-04 09:12:53 UTC
                 RTC time: Thu 2024-04-04 08:39:14
                Time zone: Europe/London (BST, +0100)
System clock synchronized: no
              NTP service: active
          RTC in local TZ: no

The following time seems to be OK:

[root@latitude juanma]# hwclock --show
2024-04-04 09:40:33.004433+01:00

But after executing the following, it fetches the wrong time

[root@latitude juanma]# hwclock --show
2024-04-04 09:40:33.004433+01:00
[root@latitude juanma]# hwclock --systohc
[root@latitude juanma]# hwclock --show
2024-04-04 10:14:57.654148+01:00

Trying to use a suggested command from ntpd, returns an error

[root@latitude juanma]# sudo ntpd -qg
ntpd: invalid option -- 'q'
usage: ntpd [-dnv] [-f file] [-p file]

Using Gnome I disabled the automatic date and time, and I set the correct one:

[root@latitude juanma]# hwclock --show
2024-04-04 10:18:08.726725+01:00
[root@latitude juanma]# timedatectl set-time "2024-04-04 09:45:00"
[root@latitude juanma]# hwclock --show
2024-04-04 09:45:02.345580+01:00
[root@latitude juanma]# timedatectl 
               Local time: Thu 2024-04-04 09:45:06 BST
           Universal time: Thu 2024-04-04 08:45:06 UTC
                 RTC time: Thu 2024-04-04 08:45:07
                Time zone: Europe/London (BST, +0100)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no

You can see that the local time is OK (as I just set it) but the UTC and RTC time are 1 hour before.

But when when I activated the automated date and time, it gets it wrong again

[root@latitude juanma]# timedatectl 
               Local time: Thu 2024-04-04 10:17:42 BST
           Universal time: Thu 2024-04-04 09:17:42 UTC
                 RTC time: Thu 2024-04-04 08:45:20
                Time zone: Europe/London (BST, +0100)
System clock synchronized: no
              NTP service: active
          RTC in local TZ: no

I have no idea where it is fetching those times from.

Last edited by joanmanel (2024-04-04 08:47:28)

Offline

#2 2024-04-04 09:12:41

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,952

Re: Wrong time since the time changed this weekend

Please post the output of

$ ntpq --peers
$ systemctl status systemd-timesyncd.service
$ systemctl status ntpd.service

[


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2024-04-04 09:46:28

cryptearth
Member
Registered: 2024-02-03
Posts: 70

Re: Wrong time since the time changed this weekend

https://fishilico.github.io/generic-con … clock.html

The problem is windows - like pretty much always when dual booting with Linux.

Why: Linux expects the bios hardware clock to be set to UTC and derives the local time from it.
Windows in conflict expect the bios hardware clock to be the local time and uses it directly.

Hence: When you sync Windows it will set the hardware clock to your local time (UTC +0 (+1 summer offset)). When you sync Linux (which you should by enable ntp sync) it will sync the hwclock to UTC and derives the systemtime +1 from it.

Offline

#4 2024-04-04 09:58:08

joanmanel
Member
Registered: 2012-11-06
Posts: 234

Re: Wrong time since the time changed this weekend

cryptearth wrote:

https://fishilico.github.io/generic-con … clock.html

The problem is windows - like pretty much always when dual booting with Linux.

Why: Linux expects the bios hardware clock to be set to UTC and derives the local time from it.
Windows in conflict expect the bios hardware clock to be the local time and uses it directly.

Hence: When you sync Windows it will set the hardware clock to your local time (UTC +0 (+1 summer offset)). When you sync Linux (which you should by enable ntp sync) it will sync the hwclock to UTC and derives the systemtime +1 from it.

This has already been done long time ago. It is also in the ARch Wiki

Offline

#5 2024-04-04 10:40:13

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,754

Re: Wrong time since the time changed this weekend

FWIW sometimes Windows updates can flip random settings, it wouldn't hurt to double check. Also and -- because we've definitely seen this get reset before -- double check https://wiki.archlinux.org/title/Dual_b … ibernation (again)

Offline

#6 2024-04-04 13:03:39

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,548
Website

Re: Wrong time since the time changed this weekend

Am I missing something here: as much as I enjoy blaming MS for everything, that just doesn't seem relevant here.  First, the error in the time is not one of being in a different TZ: it's not off by a fixed number of hours, but by roughly 34.5 minutes.  That's not a result of some other system resetting to a different TZ.

Additionally, the hardware clock was reportedly correct while the linux system clock was wrong (off by the roughly 34 minutes); and setting systohc made the hardware clock then wrong: Windows was never running during that process, right?

So as common of an explanation windows timezone settings can be at baseline for *other* clock errors in dual boot systems, that really doesn't fit these symptoms at all.

My suspicion would be a failing ntpd service or similar as Lone_Wolf's seems to be.  This is supported by the fact that the OP seems to have openntpd installed, yet is expecting to use flags for a different ntpd implementation: joanmanel, can you clarify this, which ntpd implementation are you using and how did you configure it?  Or did someone else set this up for you?

Last edited by Trilby (2024-04-04 13:07:54)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2024-04-04 14:43:03

seth
Member
Registered: 2012-09-03
Posts: 51,560

Re: Wrong time since the time changed this weekend

fixed number of hours, but by roughly 34.5 minutes.  That's not a result of some other system resetting to a different TZ

Just for the records (and to subscribe), https://www.worldtimeserver.com/learn/u … ime-zones/

Not an issue here - though couple of years ago one might have worried that this is "Boris Standard Time" (to accustom to him being always too late)

But yes, post the output Lone_Wolf asked for.

Offline

Board footer

Powered by FluxBB