I wanted to convert the iso datetime into epoch format using python datetime library.
Below is my code, but it's not working.
from datetime import datetime
epoch = datetime(1970, 1, 1)
last_updated_at = int((datetime.strptime('2020-10-16T09:29:26.580-07:00', '%Y-%m-%dT%H:%M:%S.%f %z') - epoch).total_seconds())
I'm getting below error
ValueError: time data '2020-09-01T12:47:54.863-07:00' does not match format '%Y-%m-%dT%H:%M:%S.%f %z'