Table of Contents

PrimeTime overview

PrimeTime is a pair of .NET libraries for testable clocks, virtual time, and timer registration (interval and, on modern targets, time-of-day with explicit daylight-saving policy).

Four NuGet packages are published: two production clocks (below) and two testing packages for deterministic test time. Use one production package per app and the matching testing package in test projects. See Testing packages.

Two packages, one design

Package Namespace Role
KZDev.PrimeTime KZDev.PrimeTime Superset: shared model with BCL plus NodaTime APIs on IPrimeClock (for example Instant, Duration, LocalTime timers). Includes all SystemClock functionality plus NodaTime extensions.
KZDev.SystemClock.PrimeTime KZDev.SystemClock.PrimeTime BCL foundation: core contracts using TimeProvider and BCL date/time types. Minimal dependencies.

Reference exactly one of these in a given app. They are not intended to be used together.

  1. Choosing a package — short comparison and decision table.
  2. Schedule zone naming — why APIs use Schedule (LocalScheduleTimeZone, ToScheduleLocalDate, and related names) and how that differs from “local time zone” in .NET.
  3. Persistence and time conversions — storing instants and zoned values; schedule-zone helpers vs raw NodaTime/BCL.
  4. KZDev.SystemClock.PrimeTime usage guideTimeProvider, DI defaults, BCL-focused workflow.
  5. KZDev.PrimeTime usage guide — NodaTime-first workflow and superset-only APIs.
  6. Timers, daylight saving, and testing — concepts that apply to both packages.
  7. API reference: System Clock API, PrimeTime / NodaTime API.

Source and license

Repository: github.com/kzdev-net/kzdev.primetime
License: MIT (see repository LICENSE).