Refs #32365 -- Allowed use of non-pytz timezone implementations.

This commit is contained in:
Paul Ganssle 2021-01-19 11:16:01 +01:00 committed by Carlton Gibson
parent 73ffc73b68
commit 10d1261984
11 changed files with 477 additions and 306 deletions

View file

@ -26,8 +26,15 @@ to this problem is to use UTC in the code and use local time only when
interacting with end users.
Time zone support is disabled by default. To enable it, set :setting:`USE_TZ =
True <USE_TZ>` in your settings file. Time zone support uses pytz_, which is
installed when you install Django.
True <USE_TZ>` in your settings file. By default, time zone support uses pytz_,
which is installed when you install Django; Django also supports the use of
other time zone implementations like :mod:`zoneinfo` by passing
:class:`~datetime.tzinfo` objects directly to functions in
:mod:`django.utils.timezone`.
.. versionchanged:: 3.2
Support for non-``pytz`` timezone implementations was added.
.. note::
@ -680,7 +687,8 @@ Usage
pytz_ provides helpers_, including a list of current time zones and a list
of all available time zones -- some of which are only of historical
interest.
interest. :mod:`zoneinfo` also provides similar functionality via
:func:`zoneinfo.available_timezones`.
.. _pytz: http://pytz.sourceforge.net/
.. _more examples: http://pytz.sourceforge.net/#example-usage