Function utc_datetime::leap_year[][src]

pub fn leap_year(year: u16) -> bool
Expand description

Conditions for judging leap years

  1. Divisible by 4, but not divisible by 100
  2. Divisible by 400

Example

use utc_datetime::leap_year;
assert!(leap_year(2000));
assert_eq!(leap_year(2021),false);
assert_eq!(leap_year(1900),false);