Table of Contents

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

timeZone TimeZoneInfo

Source time zone.

dateTime DateTime

Target date time.

Returns

TimeZoneInfo.AdjustmentRule

First TimeZoneInfo.AdjustmentRule instance that applies to the given dateTime or 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

timeZone TimeZoneInfo

Source time zone.

dateTime DateTime

Target date time.

Returns

int

0-based index of the first TimeZoneInfo.AdjustmentRule instance that applies to the given dateTime or -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

timeZone TimeZoneInfo

Source time zone.

dateTime DateTime

Target date time.

Returns

Bounds<DateTime>?

Range of ambiguous DateTime instances defined by the provided timeZone that contains the given dateTime or null, when dateTime is 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

timeZone TimeZoneInfo

Source time zone.

dateTime DateTime

Target date time.

Returns

Bounds<DateTime>?

Range of invalid DateTime instances defined by the provided timeZone that contains the given dateTime or null, when dateTime is valid.

GetDateTimeKind(TimeZoneInfo)

Gets DateTimeKind associated with the specified timeZone.

[Pure]
public static DateTimeKind GetDateTimeKind(this TimeZoneInfo timeZone)

Parameters

timeZone TimeZoneInfo

Source time zone.

Returns

DateTimeKind

DateTimeKind associated with the specified timeZone.