I can't find any answer to this that works for me. I'm trying to check difference between datetime for created post with datetime.now()
example of what I would like to do in view.py
if (datetime.now() - post.created_at).minutes > 10:
Do_this
else:
Do_that
I have tried with timedelta things. Also tried strptime with datetime formats. No luck
When I print the datetime.now() i get: 2018-12-10 20:22:10.535052 And with the post.created_at: 2018-12-10 20:18:52:544396+00:00
How do I make them comparable?