Class TimeZoneInfoExtensions
- Namespace
 - LfrlAnvil.Chrono.Extensions
 
- Assembly
 - LfrlAnvil.Chrono.dll
 
Contains TimeZoneInfo extension methods.
public static class TimeZoneInfoExtensions
  - Inheritance
 - 
      
      TimeZoneInfoExtensions
 
- Inherited Members
 
Methods
GetActiveAdjustmentRule(TimeZoneInfo, DateTime)
Attempts to find the first TimeZoneInfo.AdjustmentRule instance that applies to the given dateTime.
[Pure]
public static TimeZoneInfo.AdjustmentRule? GetActiveAdjustmentRule(this TimeZoneInfo timeZone, DateTime dateTime)
  Parameters
timeZoneTimeZoneInfoSource time zone.
dateTimeDateTimeTarget date time.
Returns
- TimeZoneInfo.AdjustmentRule
 First TimeZoneInfo.AdjustmentRule instance that applies to the given
dateTimeor null when none exists.
GetActiveAdjustmentRuleIndex(TimeZoneInfo, DateTime)
Attempts to find the 0-based index of the first TimeZoneInfo.AdjustmentRule instance
that applies to the given dateTime.
[Pure]
public static int GetActiveAdjustmentRuleIndex(this TimeZoneInfo timeZone, DateTime dateTime)
  Parameters
timeZoneTimeZoneInfoSource time zone.
dateTimeDateTimeTarget date time.
Returns
- int
 0-based index of the first TimeZoneInfo.AdjustmentRule instance that applies to the given
dateTimeor -1 when none exists.
GetContainingAmbiguityRange(TimeZoneInfo, DateTime)
Attempts to find a range of ambiguous DateTime instances defined by the provided timeZone
that contains the given dateTime.
[Pure]
public static Bounds<DateTime>? GetContainingAmbiguityRange(this TimeZoneInfo timeZone, DateTime dateTime)
  Parameters
timeZoneTimeZoneInfoSource time zone.
dateTimeDateTimeTarget date time.
Returns
- Bounds<DateTime>?
 Range of ambiguous DateTime instances defined by the provided
timeZonethat contains the givendateTimeor null, whendateTimeis not ambiguous.
GetContainingInvalidityRange(TimeZoneInfo, DateTime)
Attempts to find a range of invalid DateTime instances defined by the provided timeZone
that contains the given dateTime.
[Pure]
public static Bounds<DateTime>? GetContainingInvalidityRange(this TimeZoneInfo timeZone, DateTime dateTime)
  Parameters
timeZoneTimeZoneInfoSource time zone.
dateTimeDateTimeTarget date time.
Returns
- Bounds<DateTime>?
 Range of invalid DateTime instances defined by the provided
timeZonethat contains the givendateTimeor null, whendateTimeis valid.
GetDateTimeKind(TimeZoneInfo)
Gets DateTimeKind associated with the specified timeZone.
[Pure]
public static DateTimeKind GetDateTimeKind(this TimeZoneInfo timeZone)
  Parameters
timeZoneTimeZoneInfoSource time zone.
Returns
- DateTimeKind
 DateTimeKind associated with the specified
timeZone.