---
title: '|timeuntil'
description: outputs the amount of time between `from_date` and the value.
date: '2026-08-02'
categories:
  - Filter
  - Date and Time
canonical: https://coolify.djangotemplatetagsandfilters.com/filters/timeuntil/
doc_link: https://docs.djangoproject.com/en/6.0/ref/templates/builtins/#timeuntil
---

# |timeuntil

outputs the amount of time between `from_date` and the value.

## Documentation

Outputs the amount of time between the `from_date` argument, which defaults to the current time and the value.

### Variables

```django
century22 = datetime.datetime(year=2100, month=1, day=1,
        tzinfo=datetime.timezone.utc)

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

### Template

```django
{{ century22|timeuntil }}<br>
{{ century22|timeuntil:moon_landing }}
```

### Result

```django
79 years, 8 months<br>
130 years, 5 months
```

The output in the browser will look like this:

79 years, 8 months  
130 years, 5 months

- The first time period is the amount of time left until the start of the 22nd century (based on the time this documentation is being written).
- The second time period is the time between the moon landing and the start of the 22nd century.

## Commentary

This is commonly used to output how much time is remaining before some event takes place (e.g., Sale ends in 9 hours, 50 minutes).
