tempoch 0.4.4

Astronomical time primitives: typed time scales, Julian dates, UTC conversion, and interval operations.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use chrono::Utc;
use tempoch::{J2000s, Time, JD, MJD, TT, UTC};

fn main() {
    let utc_now = Time::<UTC>::from_chrono(Utc::now());
    let tt_now: Time<TT> = utc_now.to::<TT>();

    println!("UTC chrono : {}", utc_now.to_chrono().unwrap());
    println!("TT seconds : {:.6}", tt_now.to::<J2000s>());
    println!("TT JD      : {:.9}", tt_now.to::<JD>());
    println!("TT MJD     : {:.9}", tt_now.to::<MJD>());
}