tzlocal is a Python module that determines your local IANA time zone name, or returns a tzinfo object with the local time zone information on Unix and Windows. It is useful when you need the local timezone details without manually knowing the zoneinfo name, and it provides a get_localzone_name() helper to return only the timezone name.
Project status
- The source is actively maintained, with an upstream push and update on 2026-10-22, one week before today.
- The cadence is uneven: there was a long gap after March 2025, followed by a cluster of updates in June 2026 and another in October.
AI summary generated
Recent updates
5.4.5
The publisher provided no release-note text, but the repository changelog documents support for nested timezone paths in the TZ environment variable and switching tzdata downloads from FTP to HTTPS. The code also changes Windows-to-IANA timezone mappings, which can alter timezone names returned to callers and is not mentioned in that changelog.
Features5.4.4
Release 5.4.4 updates tzlocal’s local timezone detection to better tolerate malformed configuration input in /etc/clock. There are no publisher release notes included, so the behavioral change is only visible from the code diff and tests.
5.4.3
This release is a version bump to 5.4.3 with only small changes in packaging configuration and changelog metadata. The provided publisher release notes are missing, so the actual code diff is the primary source of truth for what changed.
5.4.2
Release 5.4.2 contains a version bump to tzlocal 5.4.2, but no publisher release notes were provided. The code diff shows only test-suite changes and documentation/version metadata updates, with symlink-related tests removed.
5.4.1
Release 5.4.1 contains no publisher release notes. The changelog entry added in CHANGES.txt states that tests were moved back and symlink-checking tests were removed, but the actual diff also includes packaging and test-distribution changes that are not described there.
5.4
Release 5.4 has no publisher-provided release notes in the provided data. The code diff shows a packaging and tooling update, plus runtime and compatibility changes (notably Python version support) and a small behavior tweak when reading timezone configuration files.
BreakingFeatures5.3.1
Version 5.3.1 makes changes to how tzlocal resolves the local timezone when multiple timezone configuration sources are present. Specifically, it introduces logic to compute the real zone names from candidate configs and only treats /etc/timezone as deprecated and ignorable in cases where it actually conflicts with other detected timezone sources.
5.3
Release 5.3 updates tzlocal to target newer Python versions and changes how UTC is represented internally. The implementation shifts to using the standard library zoneinfo module unconditionally and adjusts timezone configuration handling (notably on Debian).
Breaking5.2
The 5.2 release was published on 2023-10-22, but no release notes were provided in the release description. As a result, there is no stated information about new features, bug fixes, breaking changes, or security updates.
5.1
Version 5.1 primarily addresses a Unicode/IANA timezone alias mismatch, treating IANA tz name changes as aliases in Unicode data. The codebase also reflects broader changes leading up to 5.1, including moving fully to zoneinfo and adding more logging and developer tooling.
BreakingFeatures4.3.1
No release notes were provided for version 4.3.1. The included code diff shows a behavioral change in tzlocal when it cannot find timezone configuration, plus a version string bump in setup.cfg and corresponding test updates.
5.0.1
Release 5.0.1 is a small patch bump from 5.0. Based on the code diff, the functional changes are limited to logging behavior and logger handling improvements.
5.0
This release updates tzlocal to version 5.0 and includes a small fix related to timezone offset assertions. The only functional code change in the diff is within tzlocal/utils.py, while other changes are documentation and packaging metadata updates.
5.0b2
Version 5.0b2 adjusts how tzlocal validates the system timezone offset, primarily to better handle temporary non-DST periods (example given: Ramadan time in Morocco). It also changes the library's default validation behavior to warn rather than raise in cases of disagreement, and exposes assert_tz_offset at the top level for explicit checking.
Features5.0b1
Version 5.0b1 removes the pytz deprecation shim and refactors tzlocal internals to use zoneinfo directly (including on UNIX and Windows). The diff also regenerates the Windows time zone mapping file and updates the dev/test workflow via a new Makefile.
Breaking4.4b1
The provided release notes for version 4.4b1 are missing, so there is no publisher-documented information about changes, fixes, or compatibility impacts. To assess upgrade risk, you will need to compare this tag against the previous release (and review the changelog, commits, and any PRs included in 4.4b1).