rsntp
An RFC 4330 compliant Simple Network Time Protocol (SNTP) client library for Rust.
rsntp
provides a simple synchronous (blocking) API which allows synchronization with SNTPv4 servers
and uses data types from the chrono
crate for convenience.
Usage
Add this to your Cargo.toml
:
[]
= "0.1"
After that you can query the current local time with the following code:
use SntpClient;
use ;
let client = new.unwrap;
let result = client.synchronize.unwrap;
let local_time: = from;
println!