Available

amalgame-datetime

Instant ns-UTC, Duration, Stopwatch, ISO 8601.

amc package add datetime GitHub ↗ ← Back to the ecosystem

Overview

Everything is ns-UTC internally — timezone complexity is explicit, not hidden. Instant for timestamps, Duration for intervals, Stopwatch for monotonic measurements. ISO 8601 parsing/formatting.

Features

  • Instant.Now(), Instant.FromIso(s), ToIso()
  • Duration in nanoseconds (millis, secs, mins, hours)
  • Monotonic Stopwatch for NTP-immune timings
  • Explicit timezone (no silent locale fallback)
  • Pure Amalgame

Example

Minimal usage example — copy-paste runnable after install.

amc package add datetime

let sw = Stopwatch.Start()
doWork()
let elapsed = sw.Elapsed()                  // Duration
Console.WriteLine("took " + elapsed.Millis() + "ms")

let t = Instant.FromIso("2026-05-24T10:30:00Z")

At a glance

Related packages