Date obtained using sqlalchemy
'2019-12-24 08:07:22.584212'
current date
datetime.datetime.now()
I need to compare them but I don't know how to convert them to the same format, something like this:
'2019-12-24 08:07:22.584212' > datetime.datetime.now()
Mistake
TypeError: '<' not supported between instances of 'str' and 'datetime.datetime'
I would appreciate any help from you, thank you.
I found a simple solution with the dateutil library
I hope it helps someone else.
Thanks.