Validate a calendar date
Checks if the year, month, and day form a valid date. Takes leap years into account.
Note: Year 0 doesn't exist historically (1 BCE → 1 CE), but we allow it for astronomical calculations (ISO 8601 uses year 0 = 1 BCE).
Full year number
Month (1-12)
Day of month
true if valid date, false otherwise
isValidDate(2024, 2, 29) // true (leap year)isValidDate(2023, 2, 29) // false (not leap year)isValidDate(2024, 13, 1) // false (invalid month)isValidDate(2024, 4, 31) // false (April has 30 days) Copy
isValidDate(2024, 2, 29) // true (leap year)isValidDate(2023, 2, 29) // false (not leap year)isValidDate(2024, 13, 1) // false (invalid month)isValidDate(2024, 4, 31) // false (April has 30 days)
Validate a calendar date
Checks if the year, month, and day form a valid date. Takes leap years into account.
Note: Year 0 doesn't exist historically (1 BCE → 1 CE), but we allow it for astronomical calculations (ISO 8601 uses year 0 = 1 BCE).