julianday

Crates.iojulianday
lib.rsjulianday
version1.2.0
sourcesrc
created_at2020-05-02 10:56:17.036567
updated_at2022-08-26 10:09:51.305628
descriptionJulian day is the continuous count of days since the beginning of the Julian Period. This crate implements a method to convert a JulianDay or ModifiedJulianDay to and from the chrono's NaiveDate.
homepage
repositoryhttps://gitlab.com/cocainefarm/julianday
max_upload_size
id236524
size8,654
Max Audron (maxaudron)

documentation

README

mirror mirror crates.io docs.rs

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();
}
Commit count: 16

cargo fmt