ZoneInfo Module In Python

The ZoneInfo module enables Python programs to have support for IANA timezone database. The ZoneInfo class of the module supports daylight saving time as well.

Zoneinfo Updated 6 Dec 2020 1 min read

Overview

  • Through the ZoneInfo module Python standard library supports IANA timezone database.
  • The ZoneInfo module has several constants, functions and a ZoneInfo class. All of them together provide the IANA timezone semantics to the developers.
  • Prior to the introduction of ZoneInfo class, the only concrete implementation of the tzinfo abstract class was the TimeZone class.
  • TimeZone class lacks two things.
    • It is not an implementation that has been designed to support IANA databases.
    • It does not handle daylight saving times.
  • The ZoneInfo class supports both IANA timezone database as well as the daylight saving times.