Skip to content

Instantly share code, notes, and snippets.

@baude
Created September 18, 2015 14:23
Show Gist options
  • Select an option

  • Save baude/8770298d5a39078f10cb to your computer and use it in GitHub Desktop.

Select an option

Save baude/8770298d5a39078f10cb to your computer and use it in GitHub Desktop.
import datetime
epoch = datetime.datetime.utcfromtimestamp(0)
remote_pattern = '%Y-%m-%d %H:%M:%S %Z'
remote_ts = '2015-09-18 12:36:10 GMT'
remote_dt = datetime.datetime.strptime(remote_ts, remote_pattern)
foo = (remote_dt - epoch).total_seconds()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment