Fusuma

Components / Date and time

is_leap

Whether year has a 29th of February.

Whether year has a 29th of February.

Signature

pub const fn is_leap(year: i32) -> bool

Example

use fusuma::is_leap;
assert!(is_leap(2024));
assert!(!is_leap(2100), "a century is not, unless it divides by 400");
assert!(is_leap(2000));

All components · Source