ConstTimestampFormatSchema.parse(Date.now()); // ✓ Valid current timestamp
TimestampFormatSchema.parse(0); // ✓ Valid Unix epoch
TimestampFormatSchema.parse(-62135596800000); // ✓ Valid timestamp (year 1 CE)
TimestampFormatSchema.parse(1.5); // ✗ Throws - not an integer
TimestampFormatSchema.parse(9e15); // ✗ Throws - exceeds maximum timestamp
TimestampFormatSchema.parse('1234567890000'); // ✗ Throws - string not number
A Zod schema that validates numeric timestamps.
This schema validates JavaScript timestamp values (milliseconds since Unix epoch) within the valid range for JavaScript Date objects. It ensures the timestamp is an integer between -8,640,000,000,000,000 and 8,640,000,000,000,000 milliseconds, which corresponds to the range of dates that can be represented by JavaScript's Date object (approximately April 20, 271821 BCE to September 13, 275760 CE).