Crates.io | xntp |
lib.rs | xntp |
version | 0.1.3 |
source | src |
created_at | 2023-01-10 08:10:15.66989 |
updated_at | 2023-01-10 09:35:16.907983 |
description | A ntp client lib for Rust |
homepage | |
repository | https://github.com/XAnything/xntp |
max_upload_size | |
id | 755124 |
size | 3,822 |
this is a simple and small ntp time client
use xntp::NtpClient;
fn main(){
let client = NtpClient::new();
let res = client.request("ntp.aliyun.com");
println!("{}", res.unix_time);
println!("{}", res.format_time("%Y-%m-%d %H:%M:%S"));
}