Command line filter to convert epoch time values to human readable date-time strings
Epoch to Date conversion.
Simple CLI application to convert a epoch value to a date-time string.
By default input values are assumed to be provided in the number of
seconds since the epoch. This program can also convert the number of
milliseconds since the epoch, or the number of nanoseconds since the
epoch by providing either the —milliseconds or the —nanoseconds
command line flag.
By default this program displays the date-time strings in your
computer’s local time zone, which may or may not be UTC. To force this
program to output the date-time strings in UTC, use the —utc command
line flag. If your computer is configured to use UTC by default, there
is no way for this program to know what your local time zone is, so
output will always be in UTC.
When provided command line arguments, this program converts each
to a human readable date-time string. When no non-option command line
arguments are provided, this program reads from standard input, and
converts each line to the corresponding date-time string.
$ e2d 1502400972
2017-08-10 17:36:12 -0400 EDT
$ e2d --field 3 space-delimited.log
$ e2d --microseconds --delimiter , --field 3 comma-delimited.txt
$ e2d --nanoseconds --property epoch newline-terminated-json.log
If you don’t have the Go programming language installed, then you’ll
need to install a copy from
https://golang.org/dl.
Once you have Go installed:
$ go install github.com/karrick/e2d@latest