4 releases
0.2.1 | Jan 6, 2023 |
---|---|
0.2.0 | Dec 30, 2022 |
0.1.1 | Dec 30, 2022 |
0.1.0 | Dec 27, 2022 |
#461 in Date and time
344 downloads per month
Used in 3 crates
(2 directly)
5KB
51 lines
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);
Crates.io
https://crates.io/crates/year-helper
Documentation
License
lib.rs
:
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);