6 releases (stable)
1.2.0 | Aug 26, 2022 |
---|---|
1.1.0 | Jul 11, 2022 |
1.0.1 | Jun 30, 2022 |
0.2.0 | May 2, 2020 |
0.1.0 | May 2, 2020 |
#327 in Date and time
231 downloads per month
Used in 2 crates
9KB
154 lines
Julian day is the continuous count of days since the beginning of the Julian Period. This crate implements a method to convert a JulianDay to and from the chrono's NaiveDate.
Julian Day (JD
)
use chrono::NaiveDate;
use julianday::JulianDay;
fn main() {
let naivedate = NaiveDate::from_ymd(2020, 2, 18);
let julianday = JulianDay::from(naivedate);
let date = julianday.to_date();
}
Modified Julian Day (MJD
)
use chrono::NaiveDate;
use julianday::ModifiedJulianDay;
fn main() {
let naivedate = NaiveDate::from_ymd(2020, 2, 18);
let mjd = ModifiedJulianDay::from(naivedate);
let date = mjd.to_date();
}
Dependencies
~1MB
~18K SLoC