jinja2-time
Jinja2 Extension for Dates and Times
What it is and what it does
jinja2-time is a Jinja2 template extension that brings date and time functionality directly into template rendering. It provides a `now` tag that retrieves the current time in any timezone, formats it using strftime patterns, and supports relative time offsets (adding or subtracting hours, days, minutes, etc.). The extension also allows you to set a default datetime format on the environment to reduce boilerplate in templates.
The package integrates arrow for its underlying datetime handling and is designed for use cases where templates need to render dynamic timestamps or time-relative content. It has no runtime dependencies beyond jinja2 and arrow, making it lightweight to install. However, it has been abandoned since 2016 with no active maintenance, so it may not work with very recent Python or dependency versions.
Use it for:
- Render current timestamps in templates with timezone awareness and custom formatting
- Generate time-relative content by offsetting the current time in template expressions
- Template-based report generation that includes dynamically formatted dates
- Email or document templates that need to embed the current date in a specific format
- Multi-timezone template rendering where different regions see localized time output
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Jinja2 extension that adds template tags for working with dates and times, including current time retrieval with timezone support and relative time offsets.
No—not for new projects. The package is abandoned (last release 2016-06-08, last commit 2022-06-18) and offers only a thin convenience layer over jinja2 and arrow. For modern code, use arrow or Python's datetime directly in your template context, or consider a maintained Jinja2 extension. Install only if maintaining legacy code that already depends on it.
Install
jinja2-time on PyPI
pip
pip install jinja2-timeuv
uv add jinja2-timepoetry
poetry add jinja2-timeInstalling jinja2-time
Before you install
Low install friction with no runtime dependencies beyond jinja2 and arrow, which are automatically installed. However, the package is abandoned—last release was 2016-06-08 and last commit 2022-06-18—so expect no maintenance or updates.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions.
Quickstart
pip install jinja2-time
from jinja2 import Environment
env = Environment(extensions=['jinja2_time.TimeExtension'])
template = env.from_string("{% now 'utc' %}")
template.render()
Verify before relying
- Whether the package works reliably with Python versions beyond 3.5 listed in classifiers
- Compatibility with current versions of jinja2 and arrow, given the age of the last release
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 3,719 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,617,898/month — #3,713 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: jinja2_time-0.2.0-py2.py3-none-any.whl
Keywords: jinja2, extension, time
Tags
More Markup packages
PyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
markdown-it-pyA Python markdown parser that converts markdown…
permissive · top 100 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
et-xmlfileet_xmlfile writes large XML files with minimal…
permissive · top 1,000 on PyPI
tomlkitParses and edits TOML files while preserving…
permissive · top 1,000 on PyPI
docstring-parserParses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
timesTimes converts between universal (UTC) time and…
permissive · top 15,000 on PyPI
jinja2-humanize-extensionAdds humanize library filters to Jinja2…
permissive · top 5,000 on PyPI
jinja2-strcaseAdds string-case conversion filters to Jinja2…
permissive · top 15,000 on PyPI
Flask-MomentFlask-Moment adds moment.js date and time…
permissive · top 15,000 on PyPI
pytzpytz brings the Olson timezone database into…
permissive · top 100 on PyPI
jinja2-simple-tagsProvides base classes to create custom Jinja2…
permissive · top 5,000 on PyPI
timeagoFormats datetime objects and timedeltas into…
permissive · top 5,000 on PyPI
momentA Python library for parsing, manipulating, and…
permissive · top 15,000 on PyPI
aniso8601Parses ISO 8601 date, time, datetime, duration,…
permissive · top 5,000 on PyPI
strict-rfc3339Converts Unix timestamps to and from RFC3339…
copyleft · top 5,000 on PyPI