hyperlane时间库
2025年4月15日小于 1 分钟hyperlanetimerust
一个根据系统的本地设置获取当前时间的库。
安装
要使用这个库,你可以运行以下命令:
cargo add hyperlane-time
使用
use hyperlane_time::*;
println!("Current Time: {}", time());
println!("Current Date: {}", date());
println!("GMT Date: {}", gmt());
println!("Timestamp (s): {}", timestamp());
println!("Timestamp (ms): {}", timestamp_millis());
println!("Timestamp (μs): {}", timestamp_micros());
println!("Current Year: {}", year());
println!("Current Month: {}", month());
println!("Current Day: {}", day());
println!("Current Hour: {}", hour());
println!("Current Minute: {}", minute());
println!("Current Second: {}", second());
println!("Current Millis: {}", millis());
println!("Current Micros: {}", micros());
println!("Is Leap Year (1949): {}", is_leap_year(1949));
println!("Calculate Current Time: {:?}", calculate_time());
println!("Compute Date (10000 days): {:?}", compute_date(10000));
println!("Current Time with Millis: {}", time_millis());
println!("Current Time with Micros: {}", time_micros());
许可证
本项目使用 MIT 许可证。详情请见 LICENSE 文件。
贡献
欢迎贡献!请提交问题或拉取请求。
联系
如有任何问题,请通过邮件联系作者 ltpp-universe [email protected]。