2022-07-15 12:40 UTC
  • Xyne


Description: Restore system time across reboots when the internal clock is dead.
Latest Version: 2013.7.12
Source Code: src/
  • any
  • python3
Optional Dependencies:
  • systemd: service support
Arch Repositories:
  • [xyne-any]
  • [xyne-i686]
  • [xyne-x86_64]
AUR Page: timedatectl-restorer
Arch Forum Thread: 166578



This was written in response to this thread on the Arch Linux forum.

It can be used with a systemd service to restore the system clock at startup before NTP synchronized the clock.


The service is parameterized to accept a number of seconds by which to shift the shutdown time into the future. It should be at least as long as the time to shutdown and reboot the system. The ideal would be to time it to the next reboot but be conservative in estimating this. It is better to have a lagging clock than a leading clock before the time is restored to avoid consistency errors.

Once you have determined the appropriate time (e.g. 10 seconds, to be completely conservative), enable the service:

systemctl enable "timedatectl-restorer@10.service"
systemctl start "timedatectl-restorer@10.service"

The service will create a file in /run to prevent multiple restorations of the system clock in a single session if the service is restarted. Remove this file if you need to restore the clock multiple times for some reason.

echo xyne.archlinux.org | sed 's/\./@/'
XHTML 1.0 Strict CSS level 3 Atom 1.0