gostd_time
一个时间格式化处理库
Example
fn main() {
use gostd_time as time;
let t = time::Date(2009, 11, 10, 14, 30, 12, 13, time::UTC.clone());
assert_eq!(
t.String(),
"2009-11-10 14:30:12.000000013 +0000 UTC".to_string()
);
assert_eq!(t.Format(time::RFC822), "10 Nov 09 14:30 UTC".to_string());
assert_eq!(
t.Format(time::RFC1123),
"Tue, 10 Nov 2009 14:30:12 UTC".to_string()
);
println!("default: {}", t);
println!("RFC822: {}", t.Format(time::RFC822));
println!("RFC1123: {}", t.Format(time::RFC1123));
}
大写觉得有什么需要改进的,欢迎提issue或者PR。
1
共 0 条评论, 1 页
评论区
写评论还没有评论