I am having trouble converting this string '2022-07-07T10:30:00-07:00' to a datetime object in order to then extract the date and time separately.
I have tried the following code:
date_time = '2022-07-07T10:30:00-07:00'
d1 = datetime.strptime(date_time,"%Y-%m-%dT%H:%M:%S")
However,I get the following error:
ValueError: unconverted data remains: -07:00
thanks in advance