Interface IDateTimeZoneSource
Namespace: NodaTime.TimeZones
Assembly: NodaTime.dll
Syntax
public interface IDateTimeZoneSource
Remarks
The interface presumes that the available time zones are static; there is no mechanism for
updating the list of available time zones. Any time zone ID that is returned in Get
Implementations need not cache time zones or the available time zone IDs.
Caching is provided by Date
Properties
VersionId
Declaration
string VersionId { get; }
Property Value
Type | Description |
---|---|
String |
Methods
ForId(String)
Declaration
DateTimeZone ForId(string id)
Parameters
Type | Name | Description |
---|---|---|
String | id | The ID of the time zone to return. This must be one of the IDs
returned by Get |
Returns
Type | Description |
---|---|
Date |
The Date |
Remarks
The source should not attempt to cache time zones; caching is provided by Date
Note that this is permitted to return a Date
Note also that this method is not required to return the same Date
It is advised that sources should document their behaviour regarding any fixed-offset timezones
(i.e. "UTC" and "UTC+/-Offset") that are included in the list returned by Get
Exceptions
Type | Condition |
---|---|
System. |
id is null. |
Argument |
id is not supported by this source. |
GetIds()
Declaration
IEnumerable<string> GetIds()
Returns
Type | Description |
---|---|
IEnumerable<String> | The System. |
Remarks
Every value in this enumeration must return a valid time zone from For
Note that this list may optionally contain any of the fixed-offset timezones (with IDs "UTC" and "UTC+/-Offset"), but there is no requirement they be included.
MapTimeZoneId(TimeZoneInfo)
Declaration
string MapTimeZoneId(TimeZoneInfo timeZone)
Parameters
Type | Name | Description |
---|---|---|
Time |
timeZone |
Returns
Type | Description |
---|---|
String | The ID for the given system time zone for this source, or null if the system time zone has no mapping in this source. |