"""Windows time zone ids and IANA names, both ways. Windows names its zones by their standard-time name (``W. Europe Standard Time``); the contracts want an IANA name. The tables are CLDR's ``windowsZones.xml``, generated into :mod:`napalm_windows._windows_zones` by ``tools/windows_zones.py`` and never fetched at runtime: * reading, a Windows zone is the zone CLDR names for its territory ``001`` -- one of several a Windows zone stands for (``W. Europe Standard Time`` is Berlin, Vienna, Rome, ...). A zone not in the table is ``None``: the reading says it does not know rather than guess; * writing, every IANA name CLDR maps, and the tzdata links to and from them, has its Windows zone. """ from __future__ import annotations from napalm_windows._windows_zones import IANA_TO_WINDOWS, WINDOWS_TO_IANA def iana_time_zone(windows_id: str | None) -> str | None: """The IANA name of the Windows zone *windows_id*; None for one the table lacks.""" return WINDOWS_TO_IANA.get(windows_id or "") def windows_time_zone(iana: str | None) -> str | None: """The Windows zone that keeps the IANA zone *iana*; None for one Windows lacks.""" return IANA_TO_WINDOWS.get(iana or "") __all__ = ["IANA_TO_WINDOWS", "WINDOWS_TO_IANA", "iana_time_zone", "windows_time_zone"]