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

# |timesince

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

## Documentation

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

### Variables

```django
launch_date = datetime.datetime(year=1969, month=7, day=16,
        hour=13, minute=32, second=0,
        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
{{ moon_landing|timesince }}<br>
{{ launch_date|timesince:moon_landing }}
```

### Result

```django
50 years, 8 months<br>
4 days, 13 hours
```

The output in the browser will look like this:

50 years, 8 months  
4 days, 13 hours

- The first time period is the amount of time that has passed since the moon landing (based on the time this documentation is being written).
- The second time period is the time between the rocket launch and the moment Neil Armstrong stepped on the moon.

## Commentary

This is commonly used to output how much time has passed since an article was written (e.g., Posted 1 year, 2 months ago).
