How Leap Years Are Evaluated (Calculation Method)
The Gregorian leap year test applies three sequential modulo math checks.
IsLeapYear = (year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0)
Divisibility by 4 Check
Test if year modulo 4 equals 0 (year % 4 === 0). If false, it is a standard year (365 days).
Century End Check (Divisibility by 100)
If divisible by 4, test if year modulo 100 equals 0 (year % 100 === 0). If false, it IS a leap year.
400-Year Exception Check
If divisible by 100, test if year modulo 400 equals 0 (year % 400 === 0). If true, it IS a leap year; otherwise it is not.
Annual Second & Day Output
Output leap status, total days (365 vs 366), and total annual seconds.