Table of Contents

Method ToScheduleDateTimeOffset

Namespace
KZDev.PrimeTime
Assembly
KZDev.PrimeTime.dll

ToScheduleDateTimeOffset(IPrimeTime, Instant)

Maps an NodaTime.Instant to a DateTimeOffset for the wall time in the receiver's LocalScheduleDateTimeZone.

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

Parameters

time IPrimeTime
instant Instant

The absolute instant on the UTC timeline.

Returns

DateTimeOffset

A DateTimeOffset with the correct offset for 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, ZonedDateTime)

Converts a NodaTime.ZonedDateTime to a DateTimeOffset for the wall time in the receiver's LocalScheduleDateTimeZone.

public static DateTimeOffset ToScheduleDateTimeOffset(this IPrimeTime time, ZonedDateTime zonedDateTime)

Parameters

time IPrimeTime
zonedDateTime ZonedDateTime

A zoned value in any zone; only its instant is used.

Returns

DateTimeOffset

A DateTimeOffset with the correct offset for the schedule zone at that instant.

Exceptions

ArgumentNullException

time is null.

ArgumentException

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