Skip to content

Instantly share code, notes, and snippets.

@tkaemming
Created January 11, 2017 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkaemming/f41ab7626d6b16de010cd331a5cccf79 to your computer and use it in GitHub Desktop.
Save tkaemming/f41ab7626d6b16de010cd331a5cccf79 to your computer and use it in GitHub Desktop.
>>> t = int(time.time())
>>> (int(datetime.datetime.utcfromtimestamp(t).strftime('%s')) - t) / 3600
8
>>> (int(datetime.datetime.utcfromtimestamp(t).replace(tzinfo=pytz.utc).strftime('%s')) - t) / 3600
8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment