neoCLR

IMPLEMENTATION NOTE · OPEN DESIGN

Separate a time value from its source.

Date and Time represent civil values. Instant identifies a point on the timeline, Duration an elapsed amount, and Clock supplies Now. SystemClock is the current system provider.

Preview 8 implementation · September 19, 2026. This is a bounded implementation, not a complete or frozen API. Use the matching Preview 8 packages. These APIs remain open to feedback.

Dates, instants and clocks in Raven.

func ShowCurrentTime() {
    let clock: Clock = SystemClock()
    let instant = clock.Now
    let local = instant.ToLocalDateTime()
    WriteLine(local.Date.Year)
    WriteLine(local.Time.Hour)
}

This helper reads the host clock and prints the local year and hour; those values naturally vary. The complete sample also uses a fixed Clock to check deterministic Instant and Duration comparisons.

Complete executable sample → · VS Code setup →

Behavior and limits.

.NET already separates DateOnly and TimeOnly and supports injectable time through TimeProvider. This API starts with those distinctions and typed validation outcomes. The current local conversion uses host settings; it is not a general timezone or calendar API.

Detailed contract and comparisons →

PROPOSED DIRECTION

Where we’re heading.

The proposals add timezone rules, calendar-aware values and presentation through globalization. More types can make distinctions clear but bring data and conversion obligations. Formatting, parsing and culture behavior remain separate work.

Related proposals and open questions →

What would you try?

Bring a small use case, the code you tried and the behavior you expected. Which part of this contract helps, and which part should change?

Share feedback on GitHub ↗