fromJSONSchema({ type: "string", format: "date-time" }) currently maps to z.iso.datetime() and rejects valid RFC 3339 timestamps with numeric UTC offsets.
const schema = z.fromJSONSchema({ type: "string", format: "date-time" });
schema.parse("2026-07-29T14:30:00Z"); // accepted
schema.parse("2026-07-29T16:30:00+02:00"); // rejected
JSON Schema defines date-time using RFC 3339, where both Z and numeric offsets are valid. A local timestamp without an offset should remain invalid.
The mapping can preserve that behavior by using z.iso.datetime({ offset: true }). Authored JSON Schema constraints such as pattern should continue to compose with the format check.
fromJSONSchema({ type: "string", format: "date-time" })currently maps toz.iso.datetime()and rejects valid RFC 3339 timestamps with numeric UTC offsets.JSON Schema defines
date-timeusing RFC 3339, where bothZand numeric offsets are valid. A local timestamp without an offset should remain invalid.The mapping can preserve that behavior by using
z.iso.datetime({ offset: true }). Authored JSON Schema constraints such aspatternshould continue to compose with the format check.