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 timeISO Date
const Date = z.iso.date();
Date.parse("2024-01-15"); // ✓
Date.parse("2024-01-15T10:30:00Z"); // ✗ includes timeISO Time
const Time = z.iso.time();
Time.parse("10:30:00"); // ✓
Time.parse("10:30:00.123"); // ✓
Time.parse("10:30"); // ✗ missing secondsPrecision Control
const Precise = z.iso.datetime({ precision: 3 });
Precise.parse("2024-01-15T10:30:00.123Z"); // ✓
Precise.parse("2024-01-15T10:30:00Z"); // ✗ needs millisecondsWhat’s Next
- Dates — Validate Date objects
- Coercion — Convert strings to dates automatically