convert timestamps to local time or specified timezone
Direct downloads are available through the releases page.
timeconverter [options] <command>
Options
-format string
format to use (options "ANSIC", "Kitchen", "RFC1123", "RFC1123Z", "RFC3339", "RFC3339Nano", "RFC822", "RFC822Z", "RFC850", "RubyDate", "Stamp", "StampMicro", "StampMilli", "StampNano", "UnixDate", "UnixSeconds") (default "Mon 2006 Jan 02 03:04pm MST")
-location string
tzdata location to convert to (default "Local")
-type string
what type of timestamps in the input (options "iso8601", "unix") (default "iso8601")
-version
print version number and exit
Commands
help -> show this help
version -> print version number and exit
now -> print current timestamp for location and format
<value> -> string with timestamps in it
- -> pipe input with timestamps from stdin
The format is specified using Golang formatting string. See docs for more info and some examples.
The location is specified using the IANA time zone database.
$ kubectl logs my-pod | timeconverter -
$ timeconverter - < server.log
$ timeconverter 2019-03-17T00:00:00Z
$ timeconverter -location="America/Chicago" 2019-03-17T00:00:00Z
$ timeconverter -format="ANSIC" 2019-03-17T00:00:00Z
$ timeconverter -type=unix 1553534903
alias lt='timeconverter now'
alias cst='timeconverter -location="America/Chicago" now'
alias uts='timeconverter -type=unix'