Comments on How to reset time in Ubuntu after replacing CMOS battery?
Post
By default modern Ubuntu versions run the service systemd-timesyncd
in the background. It fetches the time at regular intervals and should automatically set your system time when an NTP server is reachable.
Setting the time in Ubuntu manually
Since Ubuntu use systemd, the normal systemd procedure with timedatectl
is used.
From man timedatectl
:
set-time [TIME]
Set the system clock to the specified time. This will also update the RTC time accordingly. The time may be specified in the format "2012-10-30 18:17:16".
So, to set the time manually just run the command:
sudo timedatectl set-time "2025-01-07 18:17:16"
Setting the time automatically
I cant't find a concrete command to trigger an NTP sync, but restarting the systemd-timesyncd
service should do the trick if you don't want to wait for the automatic sync.
sudo systemctl restart systemd-timesyncd
0 comment threads