Table of Contents

Method ToScheduleDateTimeOffset

Namespace
KZDev.SystemClock.PrimeTime
Assembly
KZDev.SystemClock.PrimeTime.dll

ToScheduleDateTimeOffset(IPrimeTime, DateTimeOffset)

Converts an absolute DateTimeOffset to the same instant expressed with the offset of the receiver's LocalScheduleTimeZone.

public static DateTimeOffset ToScheduleDateTimeOffset(this IPrimeTime time, DateTimeOffset instant)

Parameters

time IPrimeTime
instant DateTimeOffset

An absolute point in time (any offset input is normalized to the same instant).

Returns

DateTimeOffset

A DateTimeOffset whose offset matches the schedule zone at that instant.

Exceptions

ArgumentNullException

time is null.

ArgumentException

time is not an IPrimeClock and the schedule zone cannot be resolved.

ToScheduleDateTimeOffset(IPrimeTime, DateTime)

Converts a UTC DateTime to a DateTimeOffset in the receiver's LocalScheduleTimeZone.

public static DateTimeOffset ToScheduleDateTimeOffset(this IPrimeTime time, DateTime utcDateTime)

Parameters

time IPrimeTime
utcDateTime DateTime

An absolute UTC timeline value; must use Utc.

Returns

DateTimeOffset

A DateTimeOffset whose offset matches the schedule zone at that instant.

Exceptions

ArgumentNullException

time is null.

ArgumentException

utcDateTime does not use Utc, or time is not an IPrimeClock.