I am having a problem while comparing two dates in Django templates.
I have a date field in my model:
date_created = models.DateTimeField(auto_now=True)
I want to compare date_created by today date. So this is what I am doing in my django template:
{% if x.for_meeting.date_created < today%} # (x is the instance of MeetingRecord class where for_meeting field is Foreign key to Meeting table Where date_created)
Now I am calculating today in view like:
today = datetime.now().strftime("%B %d, %Y,%I:%M %P")
Unfortunately I am not able to compare the dates.
Please tell me what might I am doing wrong here.