6个版本
0.1.4 | 2023年9月5日 |
---|---|
0.1.3 | 2021年10月15日 |
0.1.2 | 2021年6月10日 |
0.1.1 | 2020年6月25日 |
0.0.0 | 2020年5月28日 |
#1087 在 解析器实现
3,683 每月下载量
在 4 个 包(直接使用2个)中使用
14KB
284 行
simpledateformat
类似SimpleDateFormat的日期格式
用法
let f = match fmt("yyyy-MM-dd HH:mm:ss z") {
Ok(f) => f, Err(err) => {
println!("Parse fmt error: {}", err);
return;
},
};
println!("Formated date: {}", f.format(&Local::now()));
输出
Formated date: 2020-05-30 13:32:04 +08:00
format_human(Duration::from_secs(2 * 24 * 60 * 60 + 1));
输出
2days 0hour 0min 1s
更多测试
https://git.hatter.ink/hatter/simpledateformat/src/branch/master/tests/lib_test.rs
日志
- 2020年6月23日 - v0.1.1
- 添加
simpledateformat::new_with_out_err(&str)
- 添加
impl TryFrom<&str> for SimpleDateFormat
- 添加
依赖
~1MB
~19K SLoC