Skip to content

Instantly share code, notes, and snippets.

@yamaguchiyuto
Created June 17, 2013 03:22
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 yamaguchiyuto/5794462 to your computer and use it in GitHub Desktop.
Save yamaguchiyuto/5794462 to your computer and use it in GitHub Desktop.
Encode Twitter timestamp format into secs.
import time
twitter_timestamp_str = "Tue Apr 16 04:00:29 +0000 2013"
format_str = "%a %b %d %H:%M:%S +0000 %Y"
encoded_timestamp = time.strptime(twitter_timestamp_str, format_str)
print time.mktime(encoded_timestamp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment