Noda Time
Show / Hide Table of Contents

Class WindowsZones

Representation of the <windowsZones> element of CLDR supplemental data.
Since 1.1.x
Availability net6.0, netstandard2.0
Inheritance
Object
WindowsZones
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: NodaTime.TimeZones.Cldr
Assembly: NodaTime.dll
Syntax
public sealed class WindowsZones
Remarks
See the CLDR design proposal for more details of the structure of the file from which data is taken.

Properties

MapZones

Gets an immutable collection of mappings from Windows system time zones to TZDB time zones.
Since 1.1.x
Availability net6.0, netstandard2.0
Declaration
public IList<MapZone> MapZones { get; }
Property Value
Type Description
IList<MapZone> An immutable collection of mappings from Windows system time zones to TZDB time zones.
Remarks

Each mapping consists of a single Windows time zone ID and a single territory to potentially multiple TZDB IDs that are broadly equivalent to that Windows zone/territory pair.

Mappings for a single Windows system time zone can appear multiple times in this list, in different territories. For example, "Central Standard Time" maps to different TZDB zones in different countries (the US, Canada, Mexico) and even within a single territory there can be multiple zones. Every Windows system time zone covered within this collection has a "primary" entry with a territory code of "001" (which is the value of PrimaryTerritory) and a single corresponding TZDB zone.

This collection is not guaranteed to cover every Windows time zone. Some zones may be unmappable (such as "Mid-Atlantic Standard Time") and there can be a delay between a new Windows time zone being introduced and it appearing in CLDR, ready to be used by Noda Time. (There's also bound to be a delay between it appearing in CLDR and being used in your production system.) In practice however, you're unlikely to wish to use a time zone which isn't covered here.

PrimaryMapping

Gets an immutable dictionary of primary mappings, from Windows system time zone ID to TZDB zone ID. This corresponds to the "001" territory which is present for every zone within the mapping file.
Since 1.1.x
Availability net6.0, netstandard2.0
Declaration
public IDictionary<string, string> PrimaryMapping { get; }
Property Value
Type Description
IDictionary<String, String> An immutable dictionary of primary mappings, from Windows system time zone ID to TZDB zone ID.
Remarks

Each value in the dictionary is a canonical ID in CLDR, but it may not be canonical in TZDB. For example, the ID corresponding to "India Standard Time" is "Asia/Calcutta", which is canonical in CLDR but is an alias in TZDB for "Asia/Kolkata". To obtain a canonical TZDB ID, use CanonicalIdMap.

TzdbVersion

Gets the TZDB version this Windows zone mapping data was created from.
Since 1.1.x
Availability net6.0, netstandard2.0
Declaration
public string TzdbVersion { get; }
Property Value
Type Description
String The TZDB version this Windows zone mapping data was created from.
Remarks
The CLDR mapping file usually lags behind the TZDB file somewhat - partly because the mappings themselves don't always change when the time zone data does. For example, it's entirely reasonable for a TzdbDateTimeZoneSource with a TzdbVersion of "2013b" to be supply a WindowsZones object with a TzdbVersion of "2012f".

Version

Gets the version of the Windows zones mapping data read from the original file.
Since 1.1.x
Availability net6.0, netstandard2.0
Declaration
public string Version { get; }
Property Value
Type Description
String The version of the Windows zones mapping data read from the original file.
Remarks
As with other IDs, this should largely be treated as an opaque string, but the current method for generating this from the mapping file extracts a number from an element such as <version number="$Revision: 7825 $"/>. This is a Subversion revision number, but that association should only be used for diagnostic curiosity, and never assumed in code.

WindowsVersion

Gets the Windows time zone database version this Windows zone mapping data was created from.
Since 1.1.x
Availability net6.0, netstandard2.0
Declaration
public string WindowsVersion { get; }
Property Value
Type Description
String The Windows time zone database version this Windows zone mapping data was created from.
Remarks
At the time of this writing, this is populated (by CLDR) from the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\TzVersion, so "7dc0101" for example.
In this article
Back to top Generated by DocFX