Skip to content

ZonedDateTimeSchema

const ZonedDateTimeSchema: GenericSchema<string, string>;

Defined in: temporal-schemas.ts:133

valibot schema for a zoned date-time with a bracketed IANA zone (2026-06-18T09:00-07:00[America/Los_Angeles]). Validated with Temporal.ZonedDateTime.from and normalized to the canonical string (the offset is filled in). Output is a string, not a Temporal.ZonedDateTime.

import * as v from "valibot";
import { ZonedDateTimeSchema } from "@xtandard/lib/valibot";
v.parse(ZonedDateTimeSchema, "2026-06-18T09:00[Europe/Paris]");
// "2026-06-18T09:00:00+02:00[Europe/Paris]"
v.safeParse(ZonedDateTimeSchema, "2026-06-18T09:00-07:00").issues?.[0].message;
// "Invalid zoned date-time (expected ...[Area/Location])": no bracketed zone