I have a datetime string 2021-10-20 15:42:40+00:00
that I obtain via S3
s3_object = s3_resource.Object("testunzipping", "DataPump_10000838.zip")
lastModified = s3_object.last_modified
lastModified = str(lastModified)
I need to convert it into a unixepochtimestamp. I was trying this after reading another SO answer
import datetime
time = datetime.datetime.strtotime(lastModified)
but I get this error:
"type object 'datetime.datetime' has no attribute 'strtotime'"
How else can I convert the str or the datetime object into a unixepochtimestamp?