I am receiving twitter messages that are sent at a certain date in the following format from twitter:
Tue Mar 29 08:11:25 +0000 2011
I want
Twitter API V2 sends date strings that look like this:
2020-12-15T20:17:10.000Z
This worked, to convert from string to datetime:
datetime.datetime.strptime(THE_STRING,"%Y-%m-%dT%H:%M:%S.%fZ")
The end looks like a timezone, but it's milliseconds, hence the %f. The final character, "Z" is a timezone code that means UTC, as explained, here.