Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

Leap Year Checker API

Check whether a year is a leap year under Gregorian rules (with the rule that applies and the previous/next leap years), or list the leap years in a range.

POST /api/v1/tools/leap-year-checkerMCP leap_year_checkerTime & Date

Check whether any year is a leap year, see which Gregorian rule decides it, find the next and previous leap years, and list every leap year in a range.

Input

Send these as a JSON object. Unknown fields are rejected.

year
The year to check (1 to 99999). (integer, 1 to 99999, required)
toYear
Optional end year: list every leap year from year to toYear (at most 10,000 years apart) instead. (integer, 1 to 99999)
curl https://pithlab.com/api/v1/tools/leap-year-checker \n  -H "Authorization: Bearer $PITHLAB_KEY" \n  -H "Content-Type: application/json" \n  -d '{"year":2100}'
Example response
{
  "ok": true,
  "result": {
    "year": 2100,
    "leap": false,
    "rule": "div100",
    "explanation": "2100 is divisible by 100 but not by 400, so it skips the leap day.",
    "daysInYear": 365,
    "daysInFebruary": 28,
    "previous": 2096,
    "next": 2104,
    "note": null,
    "text": "2100 is not a leap year: divisible by 100 but not by 400, so it skips the leap day. 365 days; February has 28 days."
  }
}