Gregorian Leap Year Cycle Calculator

Apply the Gregorian leap-year rule to a year, including century exceptions and the distance to the next leap year.

Description

Gregorian leap years follow a four-year rule with century exceptions and a 400-year reset.

Gregorian leap years follow a four-year rule with century exceptions and a 400-year reset. There are 97 leap years in each 400-year cycle.1

Apply the Gregorian leap-year rule to a year, including century exceptions and the distance to the next leap year.

When to use Gregorian Leap Year Cycle Calculator

Use this tool to apply the Gregorian leap-year rule to a year, including century exceptions and the distance to the next leap year.

Choose a supported reference focus or prepare the watch measurements, evidence and explicit limits requested. Confirm units and date conventions before running.

How to use Gregorian Leap Year Cycle Calculator and understand its results

  1. Choose a supported reference focus or prepare the watch measurements, evidence and explicit limits requested. Confirm units and date conventions before running.
  2. Enter year using the field table and calculation rules, then run the tool.
  3. Read centuryException, isLeapYear, leapYearPositionIn400YearCycle, yearsUntilNextLeapYear. The explanation below defines the units, signs, ordering and any flags or placeholder values.
  4. If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
Input fieldMeaningValue type; see rules belowRequirement
yearGregorian yearinteger; minimum: 1; maximum: 9999Required

Enter integer year 1–9999. Return leap status, century-exception flag, one-based leap position within the cycle or zero for nonleap years, and years to the next leap year, including zero when already leap.

leap=divisible by4 AND (not divisible by100 OR divisible by400)

Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.

Output fieldMeaningValue type
centuryExceptionNon-400 century yearboolean
isLeapYearGregorian leap yearboolean
leapYearPositionIn400YearCycleLeap-year position in 400-year cycleinteger; minimum: 0; maximum: 97
yearsUntilNextLeapYearYears until next leap yearinteger; minimum: 0; maximum: 8
json
{
  "input": {
    "year": 2100
  },
  "output": {
    "centuryException": true,
    "isLeapYear": false,
    "leapYearPositionIn400YearCycle": 0,
    "yearsUntilNextLeapYear": 4
  }
}

Limitations and assumptions

Uses the proleptic Gregorian rule, without historical adoption or alternate-calendar handling.

Numeric inputs, where present, must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors. A successfully returned false flag is an evaluated outcome; its meaning is explained above.

Alternative or Complementary methods

Use Annual Calendar Month Transition Corrector: Map a Gregorian month-end through a conventional annual-calendar model that handles 30-day months and treats February as 30 days. For a complementary task, use IANA Zone Offset at Instant: Resolve an IANA time-zone identifier to its UTC offset and local date-time at an explicit UTC instant, including daylight-saving changes in the runtime time-zone database.

References

  1. Gregorian Leap Year Cycle Calculator — tool.io

Similar or alternative tools

  • Annual Calendar Month Transition Corrector

    Map a Gregorian month-end through a conventional annual-calendar model that handles 30-day months and treats February as 30 days.

  • IANA Zone Offset at Instant

    Resolve an IANA time-zone identifier to its UTC offset and local date-time at an explicit UTC instant, including daylight-saving changes in the runtime time-zone database.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies