#timestamps

app unmillis

Given 𝑛, solves for 𝑥 in the equation unix-epoch + 𝑛 milliseconds = 𝑥

5 stable releases

1.0.7 Jan 31, 2023
1.0.4 Mar 1, 2022
1.0.3 Feb 23, 2022
1.0.2 Feb 22, 2022

#3 in #remember

Download history 6/week @ 2023-11-01 6/week @ 2023-11-08 6/week @ 2023-11-22 12/week @ 2023-11-29 5/week @ 2023-12-13 5/week @ 2023-12-20 5/week @ 2023-12-27 5/week @ 2024-01-03 6/week @ 2024-01-17 6/week @ 2024-01-24 5/week @ 2024-01-31 1/week @ 2024-02-07 53/week @ 2024-02-14

65 downloads per month

MIT license

14KB
149 lines

unmillis

Converts millisecond-precision UNIX timestamps to the more human-readable and as-precise RFC3339 form.

Examples:

$ # 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

brew tap joar/unmillis
brew install unmillis

Pre-built binaries

Binaries for macOS, Linux, and Windows can be downloaded from releases.

cargo

if you have cargo, you can run

cargo install unmillis

Usage

See tests/cmd/unmillis.md for more examples of both happy and unhappy usage patterns.

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

Dependencies

~5–6.5MB
~126K SLoC