Auto change time himself my system

Today my system change time & displays to friday 25 march 2023.
I fix it but i wander what was the reason to do it if anyone knows!
I check my csmos battery

[joe@joe-Manjaro ~]$ cat /proc/driver/rtc | grep batt
batt_status : okay

Thank’s in advance.

Hi @joe-77,

It was quite probably incorrect locale settings. See here further:

Hope this helps!

Daylight Saving Time (DST) - is a very likely cause.

Perhaps you have not enabled systemd-timesyncd.service which in conjunction with the DST which occurred this weekend in EU may have skewed your clock.

sudo timedatectl set-local-rtc 0
sudo systemctl enable --now systemd-timesyncd

Possible, but 2 days!? That’s weird!

@joe-77 The time in your BIOS may not be correct after being offline for too long, but it would not sync with the online time.

Check the output of timedatectl

  • If it says: RTC in local TZ: yes, it means that timedatectl loads the incorrect time from the BIOS on every boot.

  • If hardware clock is not correct in the BIOS, you can change time in BIOS: $ sudo hwclock -w.

  • If you want to automatically sync hardware clock every reboot, then create a systemd service unit /etc/systemd/system/hwclock-sync.service

[Unit]
Description=Sync the hardware clock in BIOS
DefaultDependencies=no
Before=shutdown.target poweroff.target

[Service]
Type=oneshot
ExecStart=/usr/bin/hwclock -w
TimeoutSec=5

[Install]
WantedBy=shutdown.target

Enable it now:

$ sudo systemctl enable --now hwclock-sync.service

Today i saw that wrong date …

If the date is correct, and only the time wasn’t, it might very well be the DST, as @linux-aarhus mentioned. But if you set up your locale, and time synchronization, it should still fix it for you…

The bios clock was wrong and i fix it.

Check the output of timedatactl

timedatactl: command not found

You have a typo. It should be:

timedatectl
timedatectl
[joe@joe-Manjaro ~]$ timedatectl
               Local time: Δευ 2023-03-27 15:26:20 EEST
           Universal time: Δευ 2023-03-27 12:26:20 UTC
                 RTC time: Δευ 2023-03-27 12:26:20
                Time zone: Europe/Athens (EEST, +0300)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

Did you run this command line before the output of timedatectl ?

sudo timedatectl set-local-rtc 0
sudo hwclock --systohc --utc
sudo systemctl enable --now systemd-timesyncd

these three commands did it for me after time/date was set to wrong values last time. i can confirm that the previous (not the last) update caused the bug with a wrong tome-setting.

They help correct the time in your OS, but not the hardware clock in BIOS without automatic time sync

For this reason I created the systemd service unit to sync/correct the hardware clock every boot.

I follow your advice /etc/systemd/system/hwclock-sync.service
but the reply of
sudo systemctl enable --now hwclock-sync.service

Failed to enable unit: Unit file hwclock-sync.service does not exist.
Also the date on bios is correct but the time is wrong.
I change time and the output of

[joe@joe-Manjaro ~]$ timedatectl
               Local time: Δευ 2023-03-27 17:34:06 EEST
           Universal time: Δευ 2023-03-27 14:34:06 UTC
                 RTC time: Δευ 2023-03-27 14:34:06
                Time zone: Europe/Athens (EEST, +0300)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

please try this

sudo timedatectl set-local-rtc 0
sudo hwclock --systohc --utc
sudo systemctl enable --now systemd-timesyncd

If you newly created that file, you must first tell systemd about it:

sudo systemctl daemon-reload

Edit:

Then you can enable and start it:

sudo systemctl enable --now hwclock-sync.service
[joe@joe-Manjaro ~]$ sudo systemctl daemon-reload
[joe@joe-Manjaro ~]$ timedatectl
               Local time: Δευ 2023-03-27 17:35:38 EEST
           Universal time: Δευ 2023-03-27 14:35:38 UTC
                 RTC time: Δευ 2023-03-27 14:35:38
                Time zone: Europe/Athens (EEST, +0300)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

I did but nothing change.

[joe@joe-Manjaro ~]$ sudo systemctl enable --now hwclock-sync.service
Failed to enable unit: Unit file hwclock-sync.service does not exist.