In Python I would like to turn my str to time object and I am receiving an error.
ValueError: time data '2022-04-13T09:52:49-04:00' does not match format
What format should I use here?
Thanks
>Solution :
Try:
>>> datetime.strptime('2022-04-13T09:52:49-04:00',"%Y-%m-%dT%H:%M:%S%z")
datetime.datetime(2022, 4, 13, 9, 52, 49, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=72000)))