Function actix_web::cookie::time::util::is_leap_year

source ยท
pub const fn is_leap_year(year: i32) -> bool
Available on crate feature cookies only.
Expand description

Returns if the provided year is a leap year in the proleptic Gregorian calendar. Uses astronomical year numbering.

assert!(!is_leap_year(1900));
assert!(is_leap_year(2000));
assert!(is_leap_year(2004));
assert!(!is_leap_year(2005));
assert!(!is_leap_year(2100));