https://github.com/joar/unmillis
Can't remember what you did on the 1640995200000th?
https://github.com/joar/unmillis
timestamps
Last synced: 3 months ago
JSON representation
Can't remember what you did on the 1640995200000th?
- Host: GitHub
- URL: https://github.com/joar/unmillis
- Owner: joar
- Created: 2022-02-16T18:03:16.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-19T12:42:00.000Z (about 1 year ago)
- Last Synced: 2025-03-11T13:09:56.058Z (4 months ago)
- Topics: timestamps
- Language: Nix
- Homepage:
- Size: 47.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# unmillis
Converts millisecond-precision UNIX timestamps to the more human-readable and
as-precise RFC3339 form.Examples:
```console
$ # 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
```## Installation
### Homebrew
```bash
brew tap joar/unmillis
brew install unmillis
```### Pre-built binaries
Binaries for macOS, Linux, and Windows can be downloaded from [releases](https://github.com/joar/unmillis/releases).
### `cargo`
if you have `cargo`, you can run
```bash
cargo install unmillis
```## Usage
See [tests/cmd/unmillis.md](tests/cmd/unmillis.md) for more examples of both
happy and unhappy usage patterns.```
USAGE:
unmillisARGS:
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```