Class TzdbZone1970Location
A location entry generated from the "zone1970.tab" file in a TZDB release. This can be used to provide
users with a choice of time zone, although it is not internationalized. This is equivalent to
TzdbZoneLocation, except that multiple countries may be represented.
Since 3.1.x
Availability net45, netstandard1.3
Inheritance
Object
TzdbZone1970Location
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: NodaTime.TimeZones
Assembly: NodaTime.dll
Syntax
public sealed class TzdbZone1970Location
Constructors
TzdbZone1970Location(Int32, Int32, IEnumerable<TzdbZone1970Location.Country>, String, String)
Creates a new location.
Since 3.1.x
Availability net45, netstandard1.3
Declaration
public TzdbZone1970Location(int latitudeSeconds, int longitudeSeconds, IEnumerable<TzdbZone1970Location.Country> countries, string zoneId, string comment)
Parameters
Type | Name | Description |
---|---|---|
Int32 | latitudeSeconds | Latitude of the location, in seconds. |
Int32 | longitudeSeconds | Longitude of the location, in seconds. |
IEnumerable<TzdbZone1970Location.Country> | countries | Countries associated with this location. Must not be null, must have at least one entry, and all entries must be non-null. |
String | zoneId | Time zone identifier of the location. Must not be null. |
String | comment | Optional comment. Must not be null, but may be empty. |
Remarks
This constructor is only public for the sake of testability. Non-test code should
usually obtain locations from a TzdbDateTimeZoneSource.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | The latitude or longitude is invalid. |
ArgumentNullException | countries, zoneId or comment is null |
Properties
Comment
Gets the comment (in English) for the mapping, if any.
Since 3.1.x
Availability net45, netstandard1.3
Declaration
public string Comment { get; }
Property Value
Type | Description |
---|---|
String | The comment (in English) for the mapping, if any. (The value returned is never null.) |
Remarks
This is usually used to differentiate between locations in the same country.
This will return an empty string if no comment was provided in the original data.
Countries
Gets the list of countries associated with this location.
Since 3.1.x
Availability net45, netstandard1.3
Declaration
public IList<TzdbZone1970Location.Country> Countries { get; }
Property Value
Type | Description |
---|---|
IList<TzdbZone1970Location.Country> | The list of countries associated with this location (The value returned is never null.) |
Remarks
The list is immutable, and will always contain at least one entry. The list is
in the order specified in "zone1970.tab", so the first entry is always the
country containing the position indicated by the latitude and longitude, and
is the most populous country in the list. No entry in this list is ever null.
Latitude
Gets the latitude in degrees; positive for North, negative for South.
Since 3.1.x
Availability net45, netstandard1.3
Declaration
public double Latitude { get; }
Property Value
Type | Description |
---|---|
Double | The latitude in degrees; positive for North, negative for South. |
Remarks
The value will be in the range [-90, 90].
Longitude
Gets the longitude in degrees; positive for East, negative for West.
Since 3.1.x
Availability net45, netstandard1.3
Declaration
public double Longitude { get; }
Property Value
Type | Description |
---|---|
Double | The longitude in degrees; positive for East, negative for West. |
Remarks
The value will be in the range [-180, 180].
ZoneId
The ID of the time zone for this location.
Since 3.1.x
Availability net45, netstandard1.3
Declaration
public string ZoneId { get; }
Property Value
Type | Description |
---|---|
String | The ID of the time zone for this location. (The value returned is never null.) |
Remarks
If this mapping was fetched from a TzdbDateTimeZoneSource, it will always be a valid ID within that source.