Calendar Date Validator
Check month lengths, leap days, and date validity.
--
How Calendar Date Validator Works?
The Calendar Date Validator works by checking the month range, the day range for that month and the leap-year rule for February 29.
- 1
Enter the date
Type a year, month and day.
- 2
Check the month
The month must be 1 to 12.
- 3
Check the day
The day must be 1 to the month's length (28, 29, 30 or 31).
- 4
Check February 29
February 29 is valid only in leap years.
Calendar Date Validator Formula
The Calendar Date Validator rule is Valid = 1 ≤ M ≤ 12 AND 1 ≤ D ≤ DaysInMonth(Y, M).
Valid(Y, M, D) = (1 ≤ M ≤ 12) ∧ (1 ≤ D ≤ DaysInMonth(Y, M)) DaysInMonth(Y, 2) = 29 if Leap(Y), else 28
- Y, M, D:
- Year, month and day entered
Example: 2026-02-29 is invalid, since 2026 is not a leap year. 2028-02-29 is valid. 2026-04-31 is invalid, since April has 30 days.
Calendar Date Validator Conversion Table
The table validates 8 dates.
| Input | Valid? | Reason |
|---|---|---|
| 2026-02-28 | Yes | February 2026 has 28 days |
| 2026-02-29 | No | 2026 is not a leap year |
| 2028-02-29 | Yes | 2028 is a leap year |
| 1900-02-29 | No | 1900 is not divisible by 400 |
| 2026-04-31 | No | April has 30 days |
| 2026-13-01 | No | Month 13 does not exist |
| 2026-06-00 | No | Day 0 does not exist |
| 2026-12-31 | Yes | December has 31 days |
What is Calendar Date Validator?
A Calendar Date Validator is a tool that checks whether a year-month-day combination exists on the Gregorian calendar.
Invalid dates slip into data from manual entry and format mix-ups. JavaScript turns 2026-02-30 into March 2, 2026 without an error, so code that skips validation stores the wrong date.
Validation checks 3 rules: month range, day range and leap years.
What are the uses of Calendar Date Validator?
There are 5 main uses of the Calendar Date Validator: form validation, data cleaning, software testing, import checks and teaching.
-
Form validation
Developers check user-entered birth dates.
-
Data cleaning
Analysts find impossible dates in a dataset.
-
Software testing
QA teams test edge cases such as February 29.
-
Import checks
Teams validate dates before loading a CSV file.
-
Teaching
Teachers explain month lengths and leap years.
Related Formats & Time Zones Tools
View All 141 Tools →Date Format Converter
Convert between specified date formats.
ISO 8601 Date Converter
Convert dates into or from ISO notation.
ISO 8601 Interval Generator
Format supplied dates as an interval.
Ambiguous Date Format Checker
Identify dates with multiple possible interpretations.
Unix Timestamp To Date Converter
Convert timestamps using a selected time zone.
Date To Unix Timestamp Converter
Convert a date and time into a timestamp.