API Reference

Comprehensive API documentation for all when-exactly classes.

Core Concepts

The foundational building blocks of when-exactly:

  • Moment - A precise point in time
  • Delta - A time difference for arithmetic operations
  • Interval - A continuous span of time between two moments
  • Collection - A sorted, deduplicated collection of intervals
  • Custom Interval - A base class for defining custom intervals

Intervals

Time intervals representing specific durations:

  • Year - A calendar year (365 or 366 days)
  • Month - A calendar month (28-31 days)
  • Week - An ISO week (7 days)
  • Day - A 24-hour day using Gregorian calendar coordinates
  • OrdinalDay - A 24-hour day using ordinal day-of-year numbering (1-366)
  • Weekday - A 24-hour day within an ISO week (1=Monday, 7=Sunday)
  • Hour - A 60-minute hour
  • Minute - A 60-second minute
  • Second - A 1-second interval

Collections

Collections of intervals with additional functionality:

  • Years - Collection of Year intervals
  • Months - Collection of Month intervals
  • Weeks - Collection of Week intervals
  • Days - Collection of Day intervals (with .months property)
  • Weekdays - Collection of Weekday intervals
  • Hours - Collection of Hour intervals
  • Minutes - Collection of Minute intervals
  • Seconds - Collection of Second intervals