$npx skillfedfor your agent

pytz

World timezone definitions, modern and historical

With conditionsPyPI Python ModulesReleased Jul 2026551.7M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pytz-2026.3.post1-py2.py3-none-any.whl
v2026.3.post1 · released 2026-07-25

Yes, if you need to support Python versions before 3.9 or maintain existing code that already uses pytz. No, if you are starting a new project on Python 3.9+—use the standard library zoneinfo module with tzdata instead. The package is actively maintained and has no known vulnerabilities, but its non-standard API and the availability of a superior standard library alternative make it a legacy choice for new development.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires use of localize() method for naive datetimes rather than the standard tzinfo constructor argument; direct tzinfo= assignment produces incorrect results for most timezones.
  • Date arithmetic across DST boundaries requires normalize() to correct timezone after operations.
  • Low install friction with no runtime dependencies.

License · maintenance · safety

MIT (permissive) — MIT license (permissive) imposes no significant restrictions on use, modification, or distribution in commercial or private projects.

last release 2026-07-25 (20 days) · last repo commit 2026-07-25 · 393 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 551,686,335 downloads/mo, #66 on PyPI

Verify before relying

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'))
  • Whether pytz remains actively maintained for new Olson database updates or if maintenance is primarily for backwards compatibility
  • Performance characteristics when handling large volumes of timezone conversions or historical timezone data queries
Same gist for agents: .md · .json

What it is and what it does

pytz is a timezone library that brings the Olson timezone database into Python, allowing you to work with real-world timezone definitions including historical changes and daylight saving time rules. It provides timezone objects you can use to localize naive datetime objects or convert between timezones using the astimezone() method.

The library solves the core problem of ambiguous times during DST transitions and handles timezone arithmetic correctly. However, it has a non-standard API: you must use its localize() method to attach timezone info to naive datetimes rather than passing tzinfo directly to the datetime constructor, and you need to call normalize() after arithmetic on local times that cross DST boundaries. The package itself recommends that projects using Python 3.9 or later use the standard library zoneinfo module with tzdata instead, since pytz offers no advantages beyond backwards compatibility with older code.

Use it for

  • Converting UTC timestamps to local times in different timezones for display to users in different regions
  • Handling ambiguous times during daylight saving time transitions by explicitly specifying is_dst parameter
  • Performing date arithmetic on local times while correctly accounting for DST boundary changes
  • Building applications that must support historical timezone definitions and past DST rules
  • Maintaining legacy codebases that depend on pytz before migration to zoneinfo is feasible

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need to support Python versions before 3.9 or maintain existing code that already uses pytz.

No, if you are starting a new project on Python 3.9+—use the standard library zoneinfo module with tzdata instead. The package is actively maintained and has no known vulnerabilities, but its non-standard API and the availability of a superior standard library alternative make it a legacy choice for new development.

Install

pytz on PyPI

Before you install

Low install friction with no runtime dependencies. Actively maintained as of 2026-07-25 with recent releases; however, the package itself notes that Python 3.9+ users should prefer the standard library zoneinfo module with tzdata package instead.

Requires use of localize() method for naive datetimes rather than the standard tzinfo constructor argument; direct tzinfo= assignment produces incorrect results for most timezones. Date arithmetic across DST boundaries requires normalize() to correct timezone after operations.

License in practice

MIT license (permissive) imposes no significant restrictions on use, modification, or distribution in commercial or private projects.

Quickstart

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'))

Verify before relying

  • Whether pytz remains actively maintained for new Olson database updates or if maintenance is primarily for backwards compatibility
  • Performance characteristics when handling large volumes of timezone conversions or historical timezone data queries

Package facts

LicenseMIT permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 20 days since the last release
Last repo commit
First released
Downloads551,686,335 / month, #66 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
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

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

Tags

Capabilities
timezone handling pythonolson database pythondatetime timezone conversiondaylight saving time pythonutc timezone localizationcross-platform timezone supporttzinfo implementation
Topics
timezone-handlinglegacy-compatibility
PyPI keywords
timezonetzinfodatetimeolsontime

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “timezone handling python”

  • pytzpytz brings the Olson timezone database into Python, enabling…
  • backports.zoneinfoProvides IANA time zone support for Python 3.6–3.8 by backporting the…
  • SQLAlchemy-UtcProvides a SQLAlchemy DateTime type that consistently handles…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also backports.zoneinfo · django-timezone-field · pendulum · pytz-deprecation-shim · times · tzlocal · DateTime · pytzdata · whenever · tzfpy