djangosnippets.org: Latest snippets tagged with 'now'https://djangosnippets.org/tags/now/2014-03-22T04:43:20.965085-05:00Template tag and filter for displaying number of years since
2014-03-22T04:43:20.965085-05:00tgandorhttps://djangosnippets.org/snippets/3037/<p>Because {% now "Y"|add:"-2005" %} - etc. doesn't work, you can use the above in your template like:</p>
<p>We have {{ 2000|since }} years of experience.</p>
<p>or:</p>
<p>Serving our customers with passion for more than {% years_since 2005 %} years.</p>
Freely redistributablehumanize time difference (how long ago)
2007-09-11T13:18:56.141557-05:00supsupmohttps://djangosnippets.org/snippets/412/<p>If you ever have a need to display something like:</p>
<p>"last update 5 days ago"
"user logged in 2 mins ago"</p>
<p>you can use this script to determine how long ago a timestamp is versus now().</p>
Freely redistributableClient-side Django-style date & time string formatting
2007-03-06T07:01:27.959819-06:00robbiehttps://djangosnippets.org/snippets/84/<p>This is a reasonably straight forward port of functionality provided by the <code>django.utils.dateformat</code> module into a method extending JavaScript's Date object. Its intended use is to allow client-side dynamic content to share the same date & time string formatting as Django template markup. By using this in conjunction with a …</p>
Freely redistributable