Table of Contents

Method ToScheduleDateOnly

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

ToScheduleDateOnly(IPrimeTime, DateTimeOffset)

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

public static DateOnly ToScheduleDateOnly(this IPrimeTime time, DateTimeOffset instant)

Parameters

time IPrimeTime
instant DateTimeOffset

An absolute point in time.

Returns

DateOnly

The calendar date 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.

ToScheduleDateOnly(IPrimeTime, DateTime)

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

public static DateOnly ToScheduleDateOnly(this IPrimeTime time, DateTime utcDateTime)

Parameters

time IPrimeTime
utcDateTime DateTime

An absolute UTC timeline value; must use Utc.

Returns

DateOnly

The calendar date 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.