Skip to Content
advanced-8y4qeprIso Date And Time

Last Updated: 3/12/2026


ISO Date and Time

Zod provides dedicated schemas for validating ISO 8601 date and time strings.

ISO DateTime

import * as z from "zod"; const DateTime = z.iso.datetime(); DateTime.parse("2024-01-15T10:30:00Z"); // ✓ DateTime.parse("2024-01-15T10:30:00.123Z"); // ✓ DateTime.parse("2024-01-15"); // ✗ missing time

ISO Date

const Date = z.iso.date(); Date.parse("2024-01-15"); // ✓ Date.parse("2024-01-15T10:30:00Z"); // ✗ includes time

ISO Time

const Time = z.iso.time(); Time.parse("10:30:00"); // ✓ Time.parse("10:30:00.123"); // ✓ Time.parse("10:30"); // ✗ missing seconds

Precision Control

const Precise = z.iso.datetime({ precision: 3 }); Precise.parse("2024-01-15T10:30:00.123Z"); // ✓ Precise.parse("2024-01-15T10:30:00Z"); // ✗ needs milliseconds

What’s Next

  • Dates — Validate Date objects
  • Coercion — Convert strings to dates automatically