GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing tzdata.python.org — tzdata documentation tzdata: Python package providing IANA time zone data¶This is a Python package containing The python/tzdata repository generates a
Overview¶
It is primarily intended to be used by standard library’s Contents¶The The package organization looks something like this: src/tzdata ├── __init__.py ├── zoneinfo │ ├── __init__.py │ ├── Africa │ │ ├── __init__.py │ │ ├── Abidjan │ │ ├── Accra │ │ ├── … │ │ └── Windhoek │ ├── America │ │ ├── __init__.py │ │ ├── Adak │ │ ├── Anchorage │ │ ├── … │ │ └── Yellowknife │ ├── … │ ├── tzdata.zi │ ├── … │ ├── zone.tab │ └── Zulu └── zones 21 directories, 623 files In addition to the zoneinfo files, it also provides a small amount of extra
metadata about the time zones. The Examples¶End users should generally not need to use this package directly and should
use a Python library like # Python 3.9+ from datetime import datetime from zoneinfo import ZoneInfo dt = datetime.now(ZoneInfo("America/New_York")) For those writing time zone libraries, the recommended mechanism for access is
to open the relevant zoneinfo binaries with
from importlib import resources # America/New_York with resources.open_binary("tzdata.zoneinfo.America", "New_York") as f: assert f.read(4) == b"TZif" Note that the way this is organized, each folder in def iana_key_to_resource(key): package_loc, resource = key.rsplit("/", 1) package = "tzdata.zoneinfo." + package_loc.replace("/", ".") return package, resource assert iana_key_to_resource("America/New_York") == \ ("tzdata.zoneinfo.America", "New_York") assert iana_key_to_resource("America/Indiana/Indianapolis") == \ ("tzdata.zoneinfo.America.Indiana", "Indianapolis") Contents: Indices and tables¶ |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |