Class MapZone
Represents a single
<mapZone>
element in the CLDR Windows zone mapping file.
Since 1.1.x
Availability netstandard2.0
Inheritance
Object
MapZone
Implements
IEquatable<MapZone>
Inherited Members
Object.Equals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
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 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 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 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 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 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 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 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 |
---|---|
Boolean | 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 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 |
---|---|
Boolean | True if the given value is another map zone equal to this one; false otherwise. |
Overrides
System.Object.Equals(System.Object)
GetHashCode()
Returns a hash code for this map zone.
See the type documentation for a description of equality semantics.
Since 2.0.x
Availability netstandard2.0
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A hash code for this map zone. |
Overrides
System.Object.GetHashCode()
ToString()
Returns a System.String that represents this instance.
Since 2.0.x
Availability netstandard2.0
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | The value of the current instance, for diagnostic purposes. |
Overrides
System.Object.ToString()
Implements
System.IEquatable<T>