I use orator to store created_at timestamps in my database tables. When I retrieve this timestamp (job.created_at) it look like this. 2019-08-16T10:36:03.562908+00:00
I need to convert this into 16-08-2019
I have tried datetime.datetime
ts = str(job.created_at)
f = '%Y-%m-%d %H:%M:%S'
print(datetime.datetime.strptime(ts, f))
This is expecting %Y-%m-%d %H:%M:%S but is being passed 2019-08-16T10:36:03.562908+00:00 so I get a format does not match error.
I'd forgotten how tricky handling dates in Python is. Is there an equivalent to php's Carbon package?
Any help would be gratefully appreciated.