Class DateTimeZoneCache
Provides a stable cache for time zone sources.
Since 1.0.x
Availability net35-Client
Inheritance
Object
DateTimeZoneCache
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Assembly: NodaTime.dll
Syntax
public sealed class DateTimeZoneCache : IDateTimeZoneProvider
Constructors
DateTimeZoneCache(IDateTimeZoneSource)
Since 1.0.x
Availability net35-Client
Declaration
public DateTimeZoneCache(IDateTimeZoneSource source)
Parameters
Exceptions
Properties
Ids
Gets the list of valid time zone ids advertised by this provider.
Since 1.0.x
Availability net35-Client
Declaration
public ReadOnlyCollection<string> Ids { get; }
Property Value
Type |
Description |
ReadOnlyCollection<String> |
The System.Collections.Generic.IEnumerable<T> of string ids. |
Item[String]
Returns the time zone for the given ID.
Since 1.0.x
Availability net35-Client
Declaration
public DateTimeZone this[string id] { get; }
Parameters
Type |
Name |
Description |
String |
id |
The time zone id to find. |
Property Value
Exceptions
Type |
Condition |
System.TimeZoneNotFoundException |
This provider does not support the given ID. |
System.ArgumentNullException |
id is null. |
VersionId
The version ID of this provider.
Since 1.0.x
Availability net35-Client
Declaration
public string VersionId { get; }
Property Value
Methods
GetSystemDefault()
Gets the time zone from this provider that matches the system default time zone, if a matching time zone is
available.
Since 1.0.x
Availability net35-Client
Declaration
public DateTimeZone GetSystemDefault()
Returns
Type |
Description |
DateTimeZone |
The provider-specific representation of the system default time zone.
|
Exceptions
Type |
Condition |
System.TimeZoneNotFoundException |
The system default time zone is not mapped by
this provider. |
GetZoneOrNull(String)
Returns the time zone for the given ID, if it's available.
Since 1.0.x
Availability net35-Client
Declaration
public DateTimeZone GetZoneOrNull(string id)
Parameters
Type |
Name |
Description |
String |
id |
The time zone ID to find. |
Returns
Exceptions
Type |
Condition |
System.ArgumentNullException |
id is null. |
Implements