Invalid means invalid.
Typed ISO parsers reject ambiguous correction, unknown annotations, and precision the library cannot preserve.
Strict, immutable utilities for JavaScript and TypeScript. Exact elapsed time stays separate from calendar wall time, ambiguous input rejects by default, and the runtime dependency count stays at zero.
Parse strict values, resolve a civil time in an IANA zone, then choose exact or calendar arithmetic explicitly.
npm install strictdatetime
import {
addCalendarToZonedDateTime,
createCalendarDuration,
parsePlainDateTime,
resolveZonedDateTime,
toZonedDateTimeString,
} from "strictdatetime";
const meeting = resolveZonedDateTime(
parsePlainDateTime("2026-03-07T12:00:00.000"),
"America/New_York",
);
const tomorrow = addCalendarToZonedDateTime(
meeting,
createCalendarDuration({
years: 0, months: 0, weeks: 0, days: 1,
}),
);
toZonedDateTimeString(tomorrow);
// 2026-03-08T12:00:00.000-04:00[America/New_York]
Typed ISO parsers reject ambiguous correction, unknown annotations, and precision the library cannot preserve.
Exact durations and calendar durations use separate APIs, so daylight-saving transitions cannot hide in a generic add call.
Values are immutable records with explicit validation. No runtime identity, mutable objects, or cross-bundle instanceof traps.
IANA behavior comes from the host runtime’s Intl data, keeping the package small while making timezone ownership explicit.
Node.js 22+ · Current Chromium, Firefox, and WebKit · MIT