I've written an rdate
implementation in Rust. It allows querying remote network time using SNTP and Time Protocol, and setting the system time accordingly. Unlike older implementations, the default is to use SNTP, as it makes no sense nowadays for the default to be the old Time Protocol.
In order to support gradual time shifts, I've added a while ago support for adjtime
to libc.
A usage example:
# rdate -va 0.debian.pool.ntp.org
Precision: 1μs (-21)
Jitter: 52.5μs
Delay: 2ms
Tue Sep 27 09:50:30 2022
adjust local clock by 0.003534 seconds (adjtime)
The code is available https://github.com/guyru/rrdate
As I'm still new to rust, coding reviews and suggestions are very welcome.