---
title: '|time'
description: for formatting times.
date: '2026-08-02'
categories:
  - Filter
  - Date and Time
canonical: https://coolify.djangotemplatetagsandfilters.com/filters/time/
doc_link: https://docs.djangoproject.com/en/6.0/ref/templates/builtins/#time
---

# |time

for formatting times.

## Documentation

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

### Variable

```django
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`](/filters/date/) filter instead.
