python-pytz
Port variant v15
Summary World timezone definitions (3.15)
Package version 2026.6
Homepage http://pythonhosted.org/pytz
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants v14
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 13 NOV 2026, 13:25:52 UTC
Port created 21 APR 2017, 05:12:41 UTC
Subpackage Descriptions
single pytz - World Timezone Definitions for Python ============================================ :Author: Stuart Bishop 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. .. caution:: Deprecated. This library fails for dates starting 2038. Use modern Python and the Python standard library. Updates continue to be made for legacy systems. .. note:: Projects using Python 3.9 or later should use the standard library [zoneinfo] module with time zone database updates from [tzdata] 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 boundaries, the result may be in an incorrect timezone (ie. subtract 1 minute from 2002-10-27 1:00 EST and you get 2002-10-27 0:59 EST instead of the correct 2002-10-27 1:59 EDT). A ``normalize()`` method is provided to correct this. Unfortunately these issues cannot be resolved without modifying the Python datetime implementation (see PEP-431). Attaching the timezone info from this module directly into ``datetime(tzinfo=pytz.timezone('US/Eastern'))`` will result in incorrect behaviour. Installation ~~~~~~~~~~~~ This package can either be installed using pip or from a tarball using the standard Python distutils. If you are installing using pip, you don't need to download anything as the latest version will be downloaded for you from PyPI:: pip install pytz If you are installing from a tarball, run the following command as an administrative user:: python setup.py install pytz for Enterprise ~~~~~~~~~~~~~~~~~~~ Available as part of the Tidelift Subscription. The maintainers of pytz and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. `Learn more. `_. Example & Usage ~~~~~~~~~~~~~~~ Localized times and date arithmetic ----------------------------------- >>> from datetime import datetime, timedelta >>> from pytz import timezone >>> import pytz >>> utc = pytz.utc >>> utc.zone 'UTC' >>> eastern = timezone('US/Eastern') >>> eastern.zone 'US/Eastern' >>> amsterdam = timezone('Europe/Amsterdam') >>> fmt = '%Y-%m-%d %H:%M:%S %Z%z' This library only supports two ways of building a localized time. The first is to use the ``localize()`` method provided by the pytz library. This is used to localize a naive datetime (datetime with no timezone information): >>> loc_dt = eastern.localize(datetime(2002, 10, 27, 6, 0, 0)) >>> print(loc_dt.strftime(fmt)) 2002-10-27 06:00:00 EST-0500
Configuration Switches (platform-specific settings discarded)
PY314 OFF Build using Python 3.14 PY315 ON Build using Python 3.15
Package Dependencies by Type
Build (only) python315:dev:std
python-pip:single:v15
autoselect-python:single:std
Build and Runtime python315:primary:std
Download groups
main mirror://PYPIWHL/b6/25/564f3fc5b70c1398d706c51f2b1470d0ea0b1b2f96fee67877b6f5bdf3b6
Distribution File Information
7fed3fee8fd6bd4a2b7b75a8d56021d0624127bf69bd5691f115db929ac570b3 506321 python-src/pytz-2026.6-py2.py3-none-any.whl
Ports that require python-pytz:v15
python-Flask-RESTful:v15 Simple framework for creating REST APIs (3.15)
python-PyDriller:v15 Framework for MSR (3.15)
python-drf-yasg:v15 Django Swagger/OpenAPI spec generator (3.15)
python-vobject:v15 Parser for iCalendar and vCard files (3.15)