Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 412 Bytes

README.md

File metadata and controls

14 lines (10 loc) · 412 Bytes

ntpclient-rust

Very simple Rust library to retrieve a time stamp from a NTP server.

NOTE: These are my first baby steps developing code using Rust.

use time::{Timespec,at};
use ntpclient::retrieve_ntp_timestamp;

let timestamp :Timespec = retrieve_ntp_timestamp("sundial.columbia.edu").unwrap();
println!("Internet time: {}", at(timestamp).asctime());