|naturalday Filter

says today or yesterday instead of a date.

Date and Time As Markdown

Argument
format (optional) – a date format string used for dates that are not today, yesterday, or tomorrow.
Requires
{% load humanize %} and "django.contrib.humanize" in INSTALLED_APPS

Documentation

Replaces a date with today, yesterday, or tomorrow when it is one of those, and formats it normally otherwise.

Template

{% load humanize %}
<p>Published {{ post.published|naturalday }}</p>

Result

<p>Published yesterday</p>

It compares dates, not moments, so anything at all on yesterday's calendar date reads as “yesterday”. When you want “3 hours ago”, reach for naturaltime instead.

More Date and Time Filters

All Date and Time Filters


Did we get something wrong? Is there a use case for the naturalday filter that we should add? Please let us know.

Send Feedback

Official Documentation
This page last updated on August 20, 2026