|time Filter

for formatting times.

Date and Time Most Useful As Markdown

Argument
format (optional) – a format string.

Documentation

Used to format the time of a datetime, date or time object.

Variable

moon_landing = datetime.datetime(year=1969, month=7, day=21,
        hour=2, minute=56, second=15,
        tzinfo=datetime.timezone.utc)

Sample Formats

  • {{ moon_landing }} – July 21, 1969, 2:56 a.m.
  • {{ moon_landing|time }} – 2:56 a.m.
  • {{ moon_landing|time:'G:i:s'}} – 02:56:15 a.m.

Commentary

If you want output both the date and time, use the date filter instead.

More Date and Time Filters

All Date and Time Filters


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

Send Feedback

Official Documentation
This page last updated on August 2, 2026