Formats & Time Zones

Calendar Date Validator

Check month lengths, leap days, and date validity.

--
days

--

Business Days
0
Weekend Days
0
Weeks
0.0
Total Hours
0 h

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. 1

    Enter the date

    Type a year, month and day.

  2. 2

    Check the month

    The month must be 1 to 12.

  3. 3

    Check the day

    The day must be 1 to the month's length (28, 29, 30 or 31).

  4. 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.

InputValid?Reason
2026-02-28YesFebruary 2026 has 28 days
2026-02-29No2026 is not a leap year
2028-02-29Yes2028 is a leap year
1900-02-29No1900 is not divisible by 400
2026-04-31NoApril has 30 days
2026-13-01NoMonth 13 does not exist
2026-06-00NoDay 0 does not exist
2026-12-31YesDecember 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 →