-
To update the timezone:
First find the correct timezone name by typing the command:
sudo timedatectl list-timezones
Then change the timezone using the following commands:
sudo su -
Timezone="Europe/London"
timedatectl set-timezone $Timezone
systemctl restart systemd-timesyncd
-
To set a local NTP server:
Note: this requires NTP/port 123 access if using an external internet time server.
Enter the following commands:
NTPserver="ntp.ubuntu.com"
timedatectl set-ntp false
cat << EOF > /etc/systemd/timesyncd.conf
# See timesyncd.conf(5) for details.[Time]
NTP=$NTPserver
EOF
systemctl stop ntp
ntpdate $NTPserver
systemctl disable ntp
timedatectl set-ntp true
hwclock --systohc
timedatectl set-local-rtc 0
Some error messages may appear, however these can be ignored.
You can check that the process has worked by typing:
timedatectl status
Note: it may take several minutes to sync with the NTP server.