django-timezone-field
A Django app providing DB, form, and REST framework fields for
zoneinfo and pytz timezone
objects.
The transition from pytz to zoneinfo
Like Django, this app supports both pytz and zoneinfo objects while the community transitions away from pytz to
zoneinfo. All exposed fields and functions that return a timezone object accept an optional boolean kwarg use_pytz.
If not explicitly specified, the default value used for use_pytz matches Django's behavior:
Django <= 3.X: use_pytz defaults to True
Django == 4.X: use_pytz defaults to the value of
django.conf.settings.USE_DEPRECATED_PYTZ,
which itself defaults to False
Django >= 5.X: django plans to
drop support for pytz altogether,
and this app will likely do the same.
Note that this app does not declare pytz to be a dependency, so if you're using this app with use_pytz=True, you'll need
to ensure pytz is included in the environment yourself.
Differences in recognized timezones between pytz and zoneinfo
pytz and z
|