---
title: '{% localtime %}'
description: turns datetime conversion on or off for a block.
date: '2026-08-21'
categories:
  - Template Tag
  - Date and Time
canonical: https://www.djangotemplatetagsandfilters.com/tags/localtime/
doc_link: >-
  https://docs.djangoproject.com/en/6.1/topics/i18n/timezones/#std-templatetag-localtime
---

# {% localtime %}

turns datetime conversion on or off for a block.

## Documentation

Controls whether datetimes inside the block are converted to the current time zone.

### Template

```django
{% load tz %}
{% localtime off %}
  {{ value }}
{% endlocaltime %}
```

With it off, aware datetimes render in UTC — occasionally what a log view or an API-ish page wants.
