Skip to content

Instantly share code, notes, and snippets.

@cjdurkin
Created May 21, 2015 14:40
Show Gist options
  • Save cjdurkin/02d9e85efc86760a22c7 to your computer and use it in GitHub Desktop.
Save cjdurkin/02d9e85efc86760a22c7 to your computer and use it in GitHub Desktop.
epoch
#!/usr/bin/env python
import time, sys
epoch = float(sys.argv[1])
ans = time.localtime(epoch)
if ans.tm_year > 3000:
ans = time.localtime(epoch/1000.0) # milliseconds
if ans.tm_isdst == 1:
tz = time.tzname[1]
else:
tz = time.tzname[0]
print time.asctime(ans), tz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment