This is a convenience function which provides a ZoneInfoFile instance using the data provided by the dateutil package. By default, it caches a single instance of the ZoneInfoFile object and returns that.


new_instance – If True, a new instance of ZoneInfoFile is instantiated and used as the cached instance for the next call. Otherwise, new instances are created only as necessary.


Returns a ZoneInfoFile object.

Added in version 2.6.


This retrieves a time zone from the local zoneinfo tarball that is packaged with dateutil.


name – An IANA-style time zone name, as found in the zoneinfo file.


Returns a time zone object.


It is generally inadvisable to use this function, and it is only provided for API compatibility with earlier versions. This is not equivalent to, which selects an appropriate time zone based on the inputs, favoring system zoneinfo. This is ONLY for accessing the dateutil-specific zoneinfo (which may be out of date compared to the system zoneinfo).

Deprecated since version 2.6: If you need to use a specific zoneinfofile over the system zoneinfo, instantiate a dateutil.zoneinfo.ZoneInfoFile object and call dateutil.zoneinfo.ZoneInfoFile.get(name)() instead.

Use get_zonefile_instance() to retrieve an instance of the dateutil-provided zoneinfo.


Get the zonefile metadata

See zonefile_metadata


A dictionary with the database metadata

Deprecated since version 2.6: See deprecation warning in zoneinfo.gettz(). To get metadata, query the attribute zoneinfo.ZoneInfoFile.metadata.

dateutil.zoneinfo.rebuild.rebuild(filename, tag=None, format='gz', zonegroups=[], metadata=None)[source]

Rebuild the internal timezone info in dateutil/zoneinfo/zoneinfo*tar*

filename is the timezone tarball from


The zonefile metadata defines the version and exact location of the timezone database to download. It is used in the script. A json encoded file is included in the source-code, and within each tar file we produce. The json file is attached here:

    "metadata_version": 2.0,
    "releases_url": [
    "tzdata_file": "tzdata2024a.tar.gz",
    "tzdata_file_sha512": "1f09f1b2327cc9e1afc7e9045e83ee3377918dafe1bee2f282b6991828d03b3c70a4d3a17f9207dfb1361bb25bc214a8922a756e84fa114e9ba476226db57236",
    "tzversion": "2024a",
    "zonegroups": [