Noda Time
Show / Hide Table of Contents

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 2.0.x
Availability net6.0, netstandard2.0
Inheritance
Object
TzdbZone1970Location
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
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 2.0.x
Availability net6.0, netstandard2.0
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.

Properties

Comment

Gets the comment (in English) for the mapping, if any.
Since 2.0.x
Availability net6.0, netstandard2.0
Declaration
public string Comment { get; }
Property Value
Type Description
String The comment (in English) for the mapping, if any.
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 2.0.x
Availability net6.0, netstandard2.0
Declaration
public IList<TzdbZone1970Location.Country> Countries { get; }
Property Value
Type Description
IList<TzdbZone1970Location.Country> The list of countries associated with this location
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 2.0.x
Availability net6.0, netstandard2.0
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 2.0.x
Availability net6.0, netstandard2.0
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 2.0.x
Availability net6.0, netstandard2.0
Declaration
public string ZoneId { get; }
Property Value
Type Description
String The ID of the time zone for this location.
Remarks
If this mapping was fetched from a TzdbDateTimeZoneSource, it will always be a valid ID within that source.
In this article
Back to top Generated by DocFX