I have a date string with format "Thu Dec 10 13:25:26 UTC 2020". I want to convert this to UTC datetime in python. How can I do that?
I had a string of format "2021-02-02T21:39:35-08:00" and I was able to convert this using the following code
from datetime import timezone
from dateutil import parser
parser.isoparse("2021-02-02T21:39:35-08:00").astimezone(timezone.utc)
>>datetime.datetime(2021, 2, 3, 5, 39, 35, tzinfo=datetime.timezone.utc)
I am not sure how to do that for the format (Thu Dec 10 13:25:26 UTC 2020) above.