Fusuma

Components / Date and time

days_in_month

How many days month (1 to 12; others are held to the ends) of year has.

How many days month (1 to 12; others are held to the ends) of year has.

Signature

pub const fn days_in_month(year: i32, month: u8) -> u8

Example

use fusuma::days_in_month;
assert_eq!(days_in_month(2024, 2), 29);
assert_eq!(days_in_month(2025, 2), 28);
assert_eq!(days_in_month(2025, 12), 31);

All components · Source