[Answered ]-Usage of timesince built in tag in Django Applications

2👍

You could write a very simple template filter:

import datetime

@register.filter(name='days_since')
def days_since(value):
    since = 0
    try:
        since = (datetime.datetime.now() - value).days
    except:
        pass
    return since


...

{{ obj.date|days_since }}

Leave a comment