By default Void does not provide an NTP daemon, so in order to have accurate network-synced time, one must be installed.
The following implementations of NTP are available in Void: OpenNTPD, Network Time Protocol daemon, Chrony and Busybox.
OpenNTPD provides the ability to sync the local clock to remote NTP servers and can act as NTP server itself. It is part of the OpenBSD project.
# xbps-install -S openntpd # ln -s /etc/sv/openntpd/ /var/service/
To configure OpenNTPD, you need to edit
/etc/ntpd.conf. See ntpd.conf(5) for all available options.
After configuring, check the configuration file for validity by executing:
$ ntpd -n
Network Time Protocol daemon
ntp is the reference implementation of the NTP protocol. NTP can be run both as a client and as a server.
# xbps-install -S ntp # ln -s /etc/sv/isc-ntpd/ /var/service/
/etc/ntp.conf restart the ntp service to use the changes.
# sv restart /var/service/isc-ntpd
chrony is a NTP client and server that is roaming friendly and designed specifically for systems that are not online all the time.
# xbps-install -S chrony # ln -s /etc/sv/chronyd/ /var/service/
busybox combines tiny versions of many common UNIX utilities into a single small executable, one of the many utilities it provides is an NTP daemon.
# xbps-install -S busybox # ln -s /etc/sv/busybox-ntpd/ /var/service/
The ntpd service
/etc/sv/ntpd will point to the NTP service in order of installation date. And can be used in place of the NTP daemon's name, allowing switching between NTP implementations without enabling and disabling their services.
Setting the Hardware Clock
If your hardware clock has the incorrect time you can set it to the system clock using:
# hwclock --systohc