Here’s an example of how the Facebook Graph API is returning date strings for me:
2011-03-06T03:36:45+0000
how would I parse this into a python datetime class? I’m aware of the datetime.strptime function, which takes in a second parameter that contains some googly-eyed format string, but don’t know which letters and dashes to include.
Here it is with time & strptime:
or with datetime:
As you see it returns the time_struct with the fields correctly filled out.
Here is a translation of the format: