Created
June 17, 2013 03:22
-
-
Save yamaguchiyuto/5794462 to your computer and use it in GitHub Desktop.
Encode Twitter timestamp format into secs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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