Skip to content

Instantly share code, notes, and snippets.

@philz
Created November 30, 2012 17:59
Show Gist options
  • Save philz/4177393 to your computer and use it in GitHub Desktop.
Save philz/4177393 to your computer and use it in GitHub Desktop.
seconds since epoch to readable
# $unixtime 1354232717
# local Thu 29 Nov 2012 03:45:17 PM PST utc Thu 29 Nov 2012 11:45:17 PM GMT
unixtime ()
{
gawk "BEGIN { print \"local\", strftime("'"'"%c"'"'", $1), \"utc\", strftime("'"'"%c"'"'", $1, 1) ; }"
}
# Alternately,
# $date -d @1354298146
# Fri Nov 30 09:55:46 PST 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment