Skip to content

TimeZones Class ​

Definition ​

Provides translation between Windows and Iana timezones

  • Namespace: JASE
  • Assembly: JASE.dll

Fields ​

NameDescription
DefaultWindowsZonesSourceUrlDefault Unicode CLDR windowsZones.xml source URL.

Properties ​

NameDescription
CountCount of known Time Zones

Methods ​

NameDescription
string GetIana(string windowsId)Returns the Primary IANA ID for a given Windows Time Zone
TimeZoneInfo GetTimeZoneInfo(string windowsOrIanaId)Resolves a TimeZoneInfo instance from either a Windows time zone ID or an IANA time zone ID.
string GetWindows(string ianaId)Returns the windows time zone for the given IANA ID
IReadOnlyList<TimeZoneMap> Parse(string input)Parse Xml content from a windowsZones.xml file or source Default source DefaultWindowsZonesSourceUrl. Use RefreshFromSourceAsync to download and refresh from the internet.
Task<IReadOnlyList<TimeZoneMap>> RefreshFromSourceAsync(CancellationToken cancellationToken = null)Downloads and reloads Windows-to-IANA time zone mappings from DefaultWindowsZonesSourceUrl.
Task<IReadOnlyList<TimeZoneMap>> RefreshFromSourceAsync(string sourceUrl, CancellationToken cancellationToken = null)Downloads and reloads Windows-to-IANA time zone mappings from the specified source URL.
bool TryGetTimeZoneInfo(string windowsOrIanaId, out TimeZoneInfo timezoneInfo)Attempts to retrieve the requested timezone by a Windows or IANA identifier