Check if device has synced time since last boot

Hello @tibhel

You can check to see whether chrony has completed it’s initial synchronisation by using the command chronyc waitsync 1. This command will return a value of 0 when chrony has synchronised. I’m not aware of any method of checking how much the time was adjusted by other than looking in the journal logs:

Nov 23 11:02:39 fc3817f chronyd[1340]: 2020-11-23T11:02:39Z System clock was stepped by 16.676809 seconds

You can also check the initial NTP synchronisation status from within a container using D-Bus. See the Checking NTP sync example here: https://www.balena.io/docs/learn/more/masterclasses/host-os-masterclass/#13-advanced-dbus-examples

Regards

Mark