Back to Explore

regebro/tzlocal

GitHub
1 watchersOpen source

Last release: 3/5/2025

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

  • Actively maintained, with recent activity in 2025 (latest listed update 5.3.1 on 2025-03-05, and an upstream push on 2025-07-08), suggesting ongoing development rather than maintenance mode.
  • Update cadence appears relatively bursty in early 2025 (5.3 on 2025-02-13, followed by 5.3.1 on 2025-03-05), but earlier history shows long gaps (for example, 5.2 in 2023).

AI summary generated 2 weeks ago

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • 5.3.1

    3/5/2025

    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

    2/13/2025

    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).

    Breaking
  • 5.2

    10/22/2023

    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

    10/4/2023

    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.

    BreakingFeatures
  • 4.3.1

    6/21/2023

    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

    5/15/2023

    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

    5/14/2023

    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

    4/11/2023

    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.

    Features
  • 5.0b1

    4/7/2023

    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.

    Breaking
  • 4.4b1

    3/20/2023

    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).