API reference / @evolu/common / Type / DateIso
Variable: DateIso
const DateIso: BrandType<
Type<"String", string, string, StringError, string, StringError>,
"DateIso",
DateIsoError,
StringError
>;
Defined in: packages/common/src/Type.ts:1057
ISO 8601 date-time string.
This Type represents a date-time string that follows the ISO 8601 format and is compatible with SQLite, which lacks a native date type and relies on ISO 8601 strings for sorting. Enforcing a 24-character format ensures correct lexicographic ordering.
It must be a valid JavaScript Date string that can be parsed.
Valid range: "0000-01-01T00:00:00.000Z" to "9999-12-31T23:59:59.999Z".
Example
const result = DateIso.from("2023-01-01T12:00:00.000Z"); // ok
const error = DateIso.from("10000-01-01T00:00:00.000Z"); // err