Skip to content

Instantly share code, notes, and snippets.

@tobym
Created September 19, 2010 20:03
Show Gist options
  • Save tobym/587073 to your computer and use it in GitHub Desktop.
Save tobym/587073 to your computer and use it in GitHub Desktop.
# Convert a UTC date to a EST date, factoring in DST
# GNU time
$ TZ=America/New_York date -d "Sep 19 04:58 UTC"
Sun Sep 19 00:58:00 EDT 2010
# BSD time (equivalent to above)
$ TZ=America/New_York date -j -f "%b %d %R %Z" "Sep 19 04:58 GMT" "+%b %d %R %Z %Y"
Sep 19 00:58 EDT 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment