zoneinfo¶
-
dateutil.zoneinfo.
get_zonefile_instance
(new_instance=False)[source]¶ This is a convenience function which provides a
ZoneInfoFile
instance using the data provided by thedateutil
package. By default, it caches a single instance of the ZoneInfoFile object and returns that.Parameters: new_instance – If True
, a new instance ofZoneInfoFile
is instantiated and used as the cached instance for the next call. Otherwise, new instances are created only as necessary.Returns: Returns a ZoneInfoFile
object.New in version 2.6.
-
dateutil.zoneinfo.
gettz
(name)[source]¶ This retrieves a time zone from the local zoneinfo tarball that is packaged with dateutil.
Parameters: name – An IANA-style time zone name, as found in the zoneinfo file. Returns: Returns a dateutil.tz.tzfile
time zone object.Warning
It is generally inadvisable to use this function, and it is only provided for API compatibility with earlier versions. This is not equivalent to
dateutil.tz.gettz()
, 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 calldateutil.zoneinfo.ZoneInfoFile.get(name)()
instead.Use
get_zonefile_instance()
to retrieve an instance of the dateutil-provided zoneinfo.
-
dateutil.zoneinfo.
gettz_db_metadata
()[source]¶ Get the zonefile metadata
Returns: A dictionary with the database metadata Deprecated since version 2.6: See deprecation warning in
zoneinfo.gettz()
. To get metadata, query the attributezoneinfo.ZoneInfoFile.metadata
.
zonefile_metadata¶
The zonefile metadata defines the version and exact location of the timezone database to download. It is used in the updatezinfo.py 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": [
"https://dateutil.github.io/tzdata/tzdata/",
"ftp://ftp.iana.org/tz/releases/"
],
"tzdata_file": "tzdata2017b.tar.gz",
"tzdata_file_sha512": "3e090dba1f52e4c63b4930b28f4bf38b56aabd6728f23094cb5801d10f4e464f17231f17b75b8866714bf98199c166ea840de0787b75b2274aa419a4e14bbc4d",
"tzversion": "2017b",
"zonegroups": [
"africa",
"antarctica",
"asia",
"australasia",
"europe",
"northamerica",
"southamerica",
"pacificnew",
"etcetera",
"systemv",
"factory",
"backzone",
"backward"
]
}