Auto change time himself my system

is there a output if you call

hwclock -h

and

sudo systemctl status systemd-timesyncd
1 Like

Please provide the output of:

sudo cat /etc/systemd/system/hwclock-sync.service

You did not create the file.

$ sudo systemctl edit --full hwclock-sync.service

OR

$ sudo nano /etc/systemd/system/hwclock-sync.service

Then copy:

[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

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

Then enable sudo timedatectl set-local-rtc true

Sorry i put hwclock-sync.service outside of system .
Now is in place.

[joe@joe-Manjaro ~]$ sudo cat /etc/systemd/system/hwclock-sync.service
[sudo] password for joe: 
[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
1 Like

Now this should work:

sudo systemctl enable --now hwclock-sync.service
sudo timedatectl set-local-rtc true

And then …

[joe@joe-Manjaro ~]$ timedatectl
               Local time: Δευ 2023-03-27 17:47:18 EEST
           Universal time: Δευ 2023-03-27 14:47:18 UTC
                 RTC time: Δευ 2023-03-27 17:47:18
                Time zone: Europe/Athens (EEST, +0300)
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'.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.