Django Date Template Filter

Django tip:

You can use the date filter to format a given date/time.


{{ post.datetime|date:"jS F Y" }}  # => 1st January 2022

After the colon, you can provide the desired format inside the string. If the format is not provided, the filter will use the default one, which can be specified in the settings.