tzlocal: Local Time Zone Information for Python

5.3.1 · active · verified Sat Mar 28

A Python module that provides the local time zone information as a tzinfo object. Current version: 5.3.1, released on March 5, 2025. Maintained under the MIT License. Requires Python 3.9 or higher. Release cadence: approximately every 6 months.

Warnings

Install

Imports

Quickstart

Retrieve and print the local time zone information.

from tzlocal import get_localzone

local_timezone = get_localzone()
print(local_timezone)

view raw JSON →