is_leap_year
Whether year is a leap year in the Gregorian calendar.
A year is leap when it is divisible by 4, except centuries, which must be divisible by 400: 2000 and 2024 are leap, 1900 and 2023 are not.
Import
Section titled “Import”Cargo feature date (enabled by default). To compile only this module:
or in Cargo.toml:
Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
year | i32 | The year to check. |
Returns
Section titled “Returns”bool — true for a leap year.
