skillfed

pytz

World timezone definitions, modern and historical

pytz Permissive license MIT Active 393 v2026.3.post1 released

Install

pytz on PyPI

pip

pip install pytz

uv

uv add pytz

poetry

poetry add pytz

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 19 days since the last release
Last repo commit
First released
Popularity one of the 100 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: pytz-2026.3.post1-py2.py3-none-any.whl

Keywords: timezone, tzinfo, datetime, olson, time

Development Status :: 6 - MatureIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.4Programming Language :: Python :: 2.5Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.1Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

About pytz

from the package's own PyPI description — quoted content, verbatim

pytz - World Timezone Definitions for Python

:Author: Stuart Bishop <stuart@stuartbishop.net>

Introduction ~~~~~~~~~~~~

pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher. It also solves the issue of ambiguous times at the end of daylight saving time, which you can read more about in the Python Library Reference (datetime.tzinfo).

Almost all of the Olson timezones are supported.

.. note::

Projects using Python 3.9 or later should use the standard library 
`zoneinfo &lt;https://docs.python.org/3/library/zoneinfo.html&gt;`_ module with
time zone database updates from `tzdata &lt;https://pypi.org/project/tzdata/&gt;`_ package.
pytz offers no advantages beyond backwards compatibility with
code written for earlier versions of Python.

.. note::

This library differs from the documented Python API for
tzinfo implementations; if you want to create local wallclock
times you need to use the ``localize()`` method documented in this
document. In addition, if you perform date arithmetic on local
times that cross DST...

Read as markdown · JSON record · Source repository · Homepage

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

pytz brings the Olson timezone database into Python, enabling accurate cross-platform timezone calculations and handling of daylight saving time transitions using the datetime module.

Installation is straightforward with low friction—pytz is a pure-Python wheel with no runtime dependencies. The package is actively maintained with a recent release (19 days old) and steady repository activity.

pytz is licensed under MIT, a permissive license that allows commercial and private use with minimal restrictions, making it suitable for most projects.

Usage

pip install pytz

from datetime import datetime
from pytz import timezone

eastern = timezone('US/Eastern')
loc_dt = eastern.localize(datetime(2002, 10, 27, 6, 0, 0))
print(loc_dt.strftime('%Y-%m-%d %H:%M:%S %Z%z'))

For Python 3.9+, the standard library zoneinfo module with tzdata package is preferred; pytz is primarily for backward compatibility with earlier Python versions.

Verdict: pytz is a mature, actively maintained timezone library with no known vulnerabilities and permissive licensing. However, the package documentation explicitly recommends Python 3.9+ users adopt the standard library zoneinfo module instead, reserving pytz mainly for legacy codebases. For older Python versions or existing pytz-dependent projects, it remains a reliable choice.

Needs verification

  • Whether the package's non-standard tzinfo API (requiring localize() and normalize() methods) creates migration friction for users transitioning to zoneinfo.
  • Current adoption trends among new projects versus legacy maintenance scenarios.
timezone handling pythonolson database pythondatetime timezone conversiondaylight saving time pythonutc timezone localizationcross-platform timezone supporttzinfo implementation

Similar packages