skillfed

jinja2-time

Jinja2 Extension for Dates and Times

jinja2-time v0.2.0 1.6M downloads/30d#3,713 on PyPI74
Permissive license MIT Abandoned released

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-time

uv

uv add jinja2-time

poetry

poetry add jinja2-time

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

jinja2 date time template tagstemplate datetime formattingjinja2 timezone supporttemplate now tagrelative time offset templatesjinja2 time extensiontemplate datetime rendering
abandonedjinja2-extension

More Markup packages