Syncronize clock on Ubuntu Core

I have a bunch of Dell 3001 running ubuntu core and is concerned about the system time being syncronized. Is there a snap to sync time? I’ve seen timedatectl mentioned…

Cheers

there are various interfaces for accessing time settings:

time-control -> gives you access to timedatectl via dbus
timeserver-control -> similar but additionally gives full write access to /etc/systemd/timesyncd.conf for setting an ntp server

(additionally there is also timezone-control that allows setting the timezone via the timedatectl dbus inteface)

you can take a look at a proof of concept snap that uses a simple shell script with the timeserver-control interface:

snap install ntpcontrol --edge
sudo ntpcontrol ... (should be self explaining)

the code can be found at https://github.com/ogra1/ntpcontrol