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
timeIPrimeTimeinstantDateTimeOffsetAn 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
timeis null.- ArgumentException
timeis 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
timeIPrimeTimeutcDateTimeDateTimeAn absolute UTC timeline value; must use Utc.
Returns
- DateTimeOffset
A DateTimeOffset whose offset matches the schedule zone at that instant.
Exceptions
- ArgumentNullException
timeis null.- ArgumentException
utcDateTimedoes not use Utc, ortimeis not an IPrimeClock.