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
timeIPrimeTimeinstantDateTimeOffsetAn 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
timeis null.- ArgumentException
timeis 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
timeIPrimeTimeutcDateTimeDateTimeAn 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
timeis null.- ArgumentException
utcDateTimedoes not use Utc, ortimeis not an IPrimeClock.