I am using the Django template filter tag timesince.
it displays well time Greater than one minute. But when is less than one minute it showing 0 minutes ago
i want it to be in seconds
here is my code
<p>{{ article.article_published_date| timesince | upto :',' }} ago</p>
I need ouput as 20seconds ago is there any way to display
The template tag am using now is
from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
@register.filter
@stringfilter
def upto(value, delimiter=None):
return (value.split(delimiter)[0])
upto.is_safe = True
any help will be appreciated
Thanks in advance