e2d

command module
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址