Temporal integration for Zod validation library
npm install zod-temporal

This library adds additional types for Zod to parse and validate dates, times and durations as
Temporal types. This library has support for both zod/v4 and zod/v4/mini.
Install via your favorite package manager:
``bash`
npm install zod-temporalor
pnpm add zod-temporalor
yarn add zod-temporal
Quick Start
Import the schema types from this package. You can either import individual types or import all types via a convenience
method:
`ts`
import { zt } from 'zod-temporal';
For zod/v4/mini, import from the mini sub-path:
`ts`
import { zt } from 'zod-temporal/mini';
This library supplies the following types:
- zt.duration()zt.plainDate()
- zt.plainDateTime()
- zt.plainTime()
- zt.offsetDateTime()
- zt.zonedDateTime()
- zt.zonedDateTime()
In contrast to zod-joda, represents date times with timezone information, whilezt.offsetDateTime() also parses to a Temporal.ZonedDateTime but cast to UTC.
The temporal schemas are implemented as codecs. This allows you to not only parse temporal
values from their ISO string representation but also to encode them back:
`ts``
const schema = zt.plainTime();
const value = schema.encode(Temporal.PlainTime.from('12:34:56.789'));