Class MapZone
Represents a single
<mapZone>
element in the CLDR Windows zone mapping file.
Since 1.1.x
Availability net6.0, net8.0, netstandard2.0
Implements
Inherited Members
Namespace: NodaTime.TimeZones.Cldr
Assembly: NodaTime.dll
Syntax
public sealed class MapZone : IEquatable<MapZone?>
Remarks
Equality is defined in a component-wise fashion. When comparing two values for equality, the TzdbIds properties must return the same IDs in the same order for the values to be considered equal.
Constructors
MapZone(string, string, IList<string>)
Creates a new mapping entry.
Since 1.1.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public MapZone(string windowsId, string territory, IList<string> tzdbIds)
Parameters
Type | Name | Description |
---|---|---|
string | windowsId | Windows system time zone identifier. Must not be null. |
string | territory | Territory code. Must not be null. |
IList<string> | tzdbIds | List of territory codes. Must not be null, and must not contains null values. |
Remarks
This constructor is only public for the sake of testability.
Fields
FixedOffsetTerritory
Identifier used for the "fixed offset" territory. A zone mapping with
this territory will always have a single entry. The value of this constant is "ZZ".
Since 1.1.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public const string FixedOffsetTerritory = "ZZ"
Field Value
Type | Description |
---|---|
string |
PrimaryTerritory
Identifier used for the primary territory of each Windows time zone. A zone mapping with
this territory will always have a single entry. The value of this constant is "001".
Since 1.1.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public const string PrimaryTerritory = "001"
Field Value
Type | Description |
---|---|
string |
Properties
Territory
Gets the territory code for this mapping.
Since 1.1.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public string Territory { get; }
Property Value
Type | Description |
---|---|
string | The territory code for this mapping. |
Remarks
This is typically either "001" to indicate that it's the primary territory for this ID, or
"ZZ" to indicate a fixed-offset ID, or a different two-character capitalized code
which indicates the geographical territory.
TzdbIds
Gets a read-only non-empty collection of TZDB zone identifiers for this mapping, such as
"America/Chicago" and "America/Matamoros" (both of which are TZDB zones associated with the "Central Standard Time"
Windows system time zone).
Since 1.1.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public IList<string> TzdbIds { get; }
Property Value
Type | Description |
---|---|
IList<string> | A read-only non-empty collection of TZDB zone identifiers for this mapping. |
Remarks
For the primary and fixed-offset territory IDs ("001" and "ZZ") this always
contains exactly one time zone ID. The IDs returned are not necessarily canonical in TZDB.
WindowsId
Gets the Windows system time zone identifier for this mapping, such as "Central Standard Time".
Since 1.1.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public string WindowsId { get; }
Property Value
Type | Description |
---|---|
string | The Windows system time zone identifier for this mapping, such as "Central Standard Time". |
Remarks
Most Windows system time zone identifiers use the name for the "standard" part of the zone as the overall identifier. Don't be fooled: just because a time zone includes "standard" in its identifier doesn't mean that it doesn't observe daylight saving time.
Methods
Equals(MapZone?)
Compares two MapZone values for equality.
See the type documentation for a description of equality semantics.
Since 2.0.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public bool Equals(MapZone? other)
Parameters
Type | Name | Description |
---|---|---|
MapZone | other | The value to compare this map zone with. |
Returns
Type | Description |
---|---|
bool | True if the given value is another map zone equal to this one; false otherwise. |
Equals(object?)
Compares two MapZone values for equality.
See the type documentation for a description of equality semantics.
Since 2.0.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The value to compare this map zone with. |
Returns
Type | Description |
---|---|
bool | True if the given value is another map zone equal to this one; false otherwise. |
Overrides
GetHashCode()
Returns a hash code for this map zone.
See the type documentation for a description of equality semantics.
Since 2.0.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for this map zone. |
Overrides
ToString()
Returns a string that represents this instance.
Since 2.0.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The value of the current instance, for diagnostic purposes. |