djangosnippets.org: Latest snippets tagged with 'diff'https://djangosnippets.org/tags/diff/2009-03-31T12:11:31.719502-05:00Smart i18n date diff (twitter like)
2009-03-31T12:11:31.719502-05:00Batistehttps://djangosnippets.org/snippets/1409/<p>This snippet display a human readable date diff. You give it the your date in parameter and the diff with datetime.datetime.now() is returned. The diff must be positive to be more accurate (future dates are not supported)</p>
<p>Usage:</p>
<pre><code>{{ status.created_at|date_diff }}
</code></pre>
<p>Will give something like:</p>
<pre><code>less than 1 minute ago …</code></pre>
Freely redistributable