I am writing some software that runs on a system that may or may not have access to the internet and I want it to behave differently depending on whether the clock is synchronised, It will likely run on a Debian-based distro, but exactly which one and which version and hence which time sync daemon is in use may vary.
Is there a way to check if time is synchronised that works across multiple time-sync implementations? (ideally at least ntpd, chronyd and systemd-timesyncd).