Noda Time
Show / Hide Table of Contents

Class TzdbZoneLocation

A location entry generated from the "zone.tab" file in a TZDB release. This can be used to provide users with a choice of time zone, although it is not internationalized.
Since 1.1.x
Availability net35-Client, PCL
Inheritance
Object
TzdbZoneLocation
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 TzdbZoneLocation

Constructors

TzdbZoneLocation(Int32, Int32, String, String, String, String)

Creates a new location.
Since 1.1.x
Availability net35-Client, PCL
Declaration
public TzdbZoneLocation(int latitudeSeconds, int longitudeSeconds, string countryName, string countryCode, string zoneId, string comment)
Parameters
Type Name Description
Int32 latitudeSeconds Latitude of the location, in seconds.
Int32 longitudeSeconds Longitude of the location, in seconds.
String countryName English country name of the location, in degrees. Must not be null.
String countryCode ISO-3166 country code of the location. Must not be 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

The comment (in English) for the mapping, if any.
Since 1.1.x
Availability net35-Client, PCL
Declaration
public string Comment { get; }
Property Value
Type Description
String
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.

CountryCode

The ISO-3166 2-letter country code for the country containing the location.
Since 1.1.x
Availability net35-Client, PCL
Declaration
public string CountryCode { get; }
Property Value
Type Description
String
Remarks
This will never be null.

CountryName

The English name of the country containing the location.
Since 1.1.x
Availability net35-Client, PCL
Declaration
public string CountryName { get; }
Property Value
Type Description
String
Remarks
This will never be null.

Latitude

Latitude in degrees; positive for North, negative for South.
Since 1.1.x
Availability net35-Client, PCL
Declaration
public double Latitude { get; }
Property Value
Type Description
Double
Remarks
The value will be in the range [-90, 90].

Longitude

Longitude in degrees; positive for East, negative for West.
Since 1.1.x
Availability net35-Client, PCL
Declaration
public double Longitude { get; }
Property Value
Type Description
Double
Remarks
The value will be in the range [-180, 180].

ZoneId

The ID of the time zone for this location.
Since 1.1.x
Availability net35-Client, PCL
Declaration
public string ZoneId { get; }
Property Value
Type Description
String
Remarks
This will never be null, and 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