--- id: django-timezone-field version: "7.2.2" license: BSD-2-Clause license_treatment: permissive maintenance: active --- # django-timezone-field — A Django app providing DB, form, and REST framework fields for zoneinfo and pytz timezone objects. License: permissive · Maintenance: active · Downloads: 8.8M/mo ## What it is and what it does django-timezone-field bridges Django models, forms, and REST serializers with Python's timezone handling, letting you store timezone identifiers in the database and retrieve them as either zoneinfo or pytz objects. It handles the transition from pytz to zoneinfo by supporting both, with defaults that follow Django's own deprecation timeline: zoneinfo is the default for Django 4.0+, while Django 5.0+ drops pytz support entirely and this package follows suit. The package stores timezone values as strings in the database but automatically converts them to timezone objects on retrieval, validates against known timezone names, and renders timezone choices in forms with optional GMT offset display. It works across Django's ORM, form validation, and Django REST Framework serialization without requiring data migrations when switching between pytz and zoneinfo. Use it for: - Store user or location timezone preferences in a Django model and retrieve them as timezone objects for datetime operations. - Build a form or API endpoint where users select their timezone from a validated dropdown or choice field. - Migrate an existing Django project from pytz to zoneinfo while keeping the same database schema and field behavior. - Display timezone choices with GMT offsets in admin or user-facing forms for clarity (e.g., 'GMT+04:00 Asia/Dubai'). - Serialize timezone data in Django REST Framework APIs, accepting and returning timezone identifiers as strings. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Django database, form, and REST framework fields for storing and working with timezone objects using either the standard library's zoneinfo or the legacy pytz library. Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a real Django need—timezone field handling—across models, forms, and REST APIs. It cleanly handles the pytz-to-zoneinfo transition and is compatible with current Django versions (4.2 through 6.1). Install it if you need timezone storage and validation in Django. ## Install pip install django-timezone-field uv add django-timezone-field poetry add django-timezone-field ## Installing django-timezone-field Before you install: Low friction: pure Python wheel with only Django and backports.zoneinfo as runtime dependencies. Actively maintained with recent releases supporting Django 6.1 and Python 3.14. License in practice: BSD-2-Clause permissive license allows commercial and private use with minimal restrictions. Quickstart: pip install django-timezone-field from django.db import models class MyModel(models.Model): tz = TimeZoneField(default="UTC") my_model = MyModel() my_model.tz # returns zoneinfo.ZoneInfo object by default Requires Django 4.2 or later; if using pytz instead of zoneinfo, pytz must be installed separately. Verify before relying: - Whether tzdata package is automatically installed or must be added separately for full IANA timezone coverage on systems with incomplete timezone databases. ## Package facts - License: BSD-2-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 8.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags django timezone field, zoneinfo django model, timezone form field django, pytz django integration, rest framework timezone serializer, django timezone database field, timezone choice field, django-orm, timezone-handling [View on SkillFed](https://skillfed.io/packages/django-timezone-field) · [View on PyPI](https://pypi.org/project/django-timezone-field/)