Expand description
§Year Helper
This library provides some useful functions to deal with years.
§Usage
let year = 2020;
let month = 2;
let leap_year = year_helper::is_leap_year(year);
let days_in_month = year_helper::get_days_in_month(year, month);
let days_in_year = year_helper::get_days_in_year(year);
// or use the following functions if the year has been determined whether it is a leap year
let days_in_month = year_helper::get_days_in_month_2(leap_year, month);
let days_in_year = year_helper::get_days_in_year_2(leap_year);Functions§
- get_
days_ in_ month - Calculate how many days in a month.
- get_
days_ in_ month_ 2 - Calculate how many days in a month.
- get_
days_ in_ year - Calculate how many days in a year.
- get_
days_ in_ year_ 2 - Calculate how many days in a year.
- is_
leap_ year - Determine whether a year is a leap year or not.