Skip to content

Instantly share code, notes, and snippets.

@nikparmar
Created March 3, 2017 12:36
Show Gist options
  • Save nikparmar/7db881bed9744b7d12cea08fdf0ea9f5 to your computer and use it in GitHub Desktop.
Save nikparmar/7db881bed9744b7d12cea08fdf0ea9f5 to your computer and use it in GitHub Desktop.
from datetime import datetime
def convert_twitter_date_time_to_object(twitter_date_time):
try:
#_date = datetime.strptime("Thu Feb 23 13:42:39 +0000 2017", '%a %b %d %H:%M:%S +0000 %Y')
_date = datetime.strptime(twitter_date_time, '%a %b %d %H:%M:%S +0000 %Y')
return _date
except Exception as e:
return e.message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment