Table of Contents

Method ToScheduleTimeOnly

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

ToScheduleTimeOnly(IPrimeTime, DateTimeOffset)

Converts an absolute DateTimeOffset to a TimeOnly in the receiver's LocalScheduleTimeZone.

public static TimeOnly ToScheduleTimeOnly(this IPrimeTime time, DateTimeOffset instant)

Parameters

time IPrimeTime
instant DateTimeOffset

An absolute point in time.

Returns

TimeOnly

The wall time of day in the schedule zone.

Remarks

Only supported in .NET 8+. Not supported in NetStandard 2.0.

Exceptions

ArgumentNullException

time is null.

ArgumentException

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

ToScheduleTimeOnly(IPrimeTime, DateTime)

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

public static TimeOnly ToScheduleTimeOnly(this IPrimeTime time, DateTime utcDateTime)

Parameters

time IPrimeTime
utcDateTime DateTime

An absolute UTC timeline value; must use Utc.

Returns

TimeOnly

The wall time of day in the schedule zone.

Remarks

Only supported in .NET 8+. Not supported in NetStandard 2.0.

Exceptions

ArgumentNullException

time is null.

ArgumentException

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