Skip to content
/ e2d Public

Command line filter to convert epoch time values to human readable date-time strings

License

Notifications You must be signed in to change notification settings

karrick/e2d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

e2d

Epoch to Date conversion.

Description

Simple CLI application to convert a epoch value to a date-time string.

Usage

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

Translate the value of a particular text field.

$ e2d --field 3 space-delimited.log

Translate the value of a particular text field with a non-space delimiter.

$ e2d --microseconds --delimiter , --field 3 comma-delimited.txt

Translate the value of a JSON property.

$ e2d --nanoseconds --property epoch newline-terminated-json.log

Installation

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

About

Command line filter to convert epoch time values to human readable date-time strings

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages