Interface IDateTimeZoneProvider
Namespace: NodaTime
Assembly: NodaTime.dll
Syntax
public interface IDateTimeZoneProvider
Remarks
Consumers should be able to treat an IDate
Implementations designed to work with any IDate
Properties
Ids
Declaration
ReadOnlyCollection<string> Ids { get; }
Property Value
Type | Description |
---|---|
Read |
The System. |
Remarks
This list will be sorted in ordinal lexicographic order. It cannot be modified by callers, and must not be modified by the provider either: client code can safely treat it as thread-safe and deeply immutable.
In addition to the list returned here, providers always support the fixed-offset timezones with IDs "UTC" and "UTC+/-Offset". These may or may not be included explicitly in this list.
Item[String]
Declaration
DateTimeZone this[string id] { get; }
Parameters
Type | Name | Description |
---|---|---|
String | id | The time zone id to find. |
Property Value
Type | Description |
---|---|
Date |
The Date |
Remarks
Unlike Get
Note that this may return a Date
Note also that this method is not required to return the same Date
The fixed-offset timezones with IDs "UTC" and "UTC+/-Offset" are always available. These must
return instances that are equal to those returned by For
Exceptions
Type | Condition |
---|---|
Date |
This provider does not support the given ID. |
Argument |
id is null. |
VersionId
Declaration
string VersionId { get; }
Property Value
Type | Description |
---|---|
String |
Methods
GetSystemDefault()
Declaration
DateTimeZone GetSystemDefault()
Returns
Type | Description |
---|---|
Date |
The provider-specific representation of the system default time zone. |
Remarks
Callers should be aware that this method will throw Date
If it is necessary to handle this case, callers can construct a
BclBclDateTimeZone
is not available on the PCL build of Noda Time, so
this fallback strategy can only be used with the desktop version.
Exceptions
Type | Condition |
---|---|
Date |
The system default time zone is not mapped by this provider. |
GetZoneOrNull(String)
Declaration
DateTimeZone GetZoneOrNull(string id)
Parameters
Type | Name | Description |
---|---|---|
String | id | The time zone ID to find. |
Returns
Type | Description |
---|---|
Date |
The Date |
Remarks
Note that this may return a Date
Note also that this method is not required to return the same Date
The fixed-offset timezones with IDs "UTC" and "UTC+/-Offset" are always available. These must
return instances that are equal to those returned by For
Exceptions
Type | Condition |
---|---|
Argument |
id is null. |