Skip to content

Commit f59be09

Browse files
authoredAug 23, 2023
clarify datetime ISO 8601 (#2673)
1 parent 9bd3879 commit f59be09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ z.string().regex(regex);
721721
z.string().includes(string);
722722
z.string().startsWith(string);
723723
z.string().endsWith(string);
724-
z.string().datetime(); // defaults to UTC, see below for options
724+
z.string().datetime(); // ISO 8601; default is without UTC offset, see below for options
725725
z.string().ip(); // defaults to IPv4 and IPv6, see below for options
726726

727727
// transformations
@@ -760,7 +760,7 @@ z.string().ip({ message: "Invalid IP address" });
760760

761761
### ISO datetimes
762762

763-
The `z.string().datetime()` method defaults to UTC validation: no timezone offsets with arbitrary sub-second decimal precision.
763+
The `z.string().datetime()` method enforces ISO 8601; default is no timezone offsets and arbitrary sub-second decimal precision.
764764

765765
```ts
766766
const datetime = z.string().datetime();

0 commit comments

Comments
 (0)
Please sign in to comment.