5 个稳定版本
1.0.7 | 2023年1月31日 |
---|---|
1.0.4 | 2022年3月1日 |
1.0.3 | 2022年2月23日 |
1.0.2 | 2022年2月22日 |
1 in #milliseconds
14KB
149 代码行
unmillis
将毫秒级UNIX时间戳转换为更易读且精度相同的RFC3339格式。
示例
$ # can't remember what you did on the 1640995200000th?
$ unmillis 1640995200000th
2022-01-01T00:00:00+00:00
$ unmillis -1000
1969-12-31T23:59:59+00:00
$ unmillis 1
1970-01-01T00:00:00.001+00:00
$ unmillis 1000, # garbage characters will be ignored
1970-01-01T00:00:01+00:00
安装
Homebrew
brew tap joar/unmillis
brew install unmillis
预编译的二进制文件
macOS、Linux和Windows的二进制文件可以从发布版下载。
cargo
如果您有 cargo
,您可以使用
cargo install unmillis
用法
有关使用示例,请参阅tests/cmd/unmillis.md。
USAGE:
unmillis <TIMESTAMP_MILLIS>
ARGS:
<TIMESTAMP_MILLIS> A timestamp formulated as the number of milliseconds since "1970-01-
01T00:00:00+00:00".
• Trailing and leading garbage is thrown away, i.e.
• `1 hello there`, `1,` and `"1",` would all be interpreted as `1`.
• Negative numbers are fine, positive numbers are ok too, both have
some limitations:
• We can't construct datetimes outside the range of (-262144-01-
01T00:00:00Z, +262143-12-31T23:59:59.999999999Z), so
• we only accept input values in the range of (-8334632851200000,
8210298412799999)
OPTIONS:
--help Print help information
--version Print version information
依赖关系
~5–7MB
~129K SLoC