roc-time
Dates, booking availability and schedules with explicit calendar and time-zone choices.
See the release notes for the compatible compiler and immutable package URLs.
Tier 1: Use today
- Form input: GregorianDate and ClockTime parse native date/clock text and compose with generic string codecs. LocalDateTime reads explicitly Gregorian local labels without choosing a zone.
- Everyday display: EnglishGregorian writes dates such as
7 Sep 2026and local appointments such as7 Sep 2026, 09:30, with explicit precision and no hidden rounding. - Booking availability: ExactInterval reads exact booking windows; Coverage subtracts occupied time and finds free windows.
- Expiry checks: the clock deadline application passes a platform clock reading to pure expiry/JSON operations through PosixBoundary and OffsetTimestamp.
- Date calculations: GregorianDate and CalendarDate support Gregorian/Julian dates; CalendarArithmetic makes month-end policy explicit.
- Reporting: Gregorian weekday, ordinal-day and ISO week-date queries support grouping by accounting date. The invoice report groups across New Year without confusing the ISO week-year with the calendar year.
- Clock changes: ZoneRules interprets repeated/skipped local times using explicit rules and policies. The named-zone appointment application combines parsing, civil-day stepping and display in another zone.
- Schedules: DateRecurrence and TimedSchedule provide bounded, resumable date and appointment queries. ICalDateRule imports and exports canonical DATE properties; the schedule exchange application demonstrates checked editing and reimport.
- Archive meaning: EdtfDate preserves date precision and supported scoped qualifications; Explanation explains supported values. Store supported standard text directly.
Tier 2: Use within supported profiles
- Timestamp text supports complete offset timestamps with up to six fractional digits; leap seconds are outside this POSIX profile.
- Native local labels use at most microsecond precision and do not retain supplied-field resolution. Canonical Gregorian date text covers the full signed provider year range; local text does not implicitly convert other calendars.
- English Gregorian display supports one fixed language/calendar profile. Minute or second precision rejects omitted nonzero fields; exact output preserves every microsecond. Other calendars require explicit conversion.
- EDTF text supports year, year-month and date with whole-value, individual and year/month group qualifiers. Interval endpoints, masks and sets remain planned.
- IXDTF retains annotations and checks offset assertions against supplied rules. Calendar presentation currently supports Gregorian only.
- Date and timed RFC recurrence adapters accept extracted property values, not complete ICS files. Canonical DATE export supports the same declared profile; timed export and native recurrence persistence remain planned.
- The optional IANA zone-data package is a separate source dependency with a declared version and date horizon.
Tier 3: Next priorities
Finish timed schedule export and durable definitions. Broader archive forms, calendars and advanced explanations follow concrete caller needs. See what comes next.
Start with a complete task
The booking exchange example reads bookings, computes availability and writes canonical timestamps. The archive search example preserves date precision and uncertainty. The README setup instructions explain the declared compiler and published dependencies; the example catalog lists more applications.
API code blocks import modules through a package dependency named time. Fallible constructors and parsers return Try for invalid input; ? forwards an error from a function returning Try.
Dates, coordinates and limits
A civil date is not an instant. A local clock label needs an explicit offset or zone before it becomes a resolved boundary. Core calculations do not read the clock, use the machine's zone or download a database.
Spans include their start and exclude their end. Calendar days and months differ from coordinate durations across clock changes. A Limited batch is incomplete: resume its cursor to preserve COUNT, exclusions and pending interpretation.