astrotime 0.2.1

Time related types
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use astrotime::{DateTime, Gregorian, Instant, Tai, Tcg, Tt, Utc};

fn main() {
    let now = std::time::SystemTime::now();
    let now: Instant = TryFrom::try_from(now).unwrap();
    let now_gregorian_utc: DateTime<Gregorian, Utc> = From::from(now);
    println!("{}", now_gregorian_utc);
    let now_gregorian_tai: DateTime<Gregorian, Tai> = From::from(now);
    println!("{}", now_gregorian_tai);
    let now_gregorian_tt: DateTime<Gregorian, Tt> = From::from(now);
    println!("{}", now_gregorian_tt);
    let now_gregorian_tcg: DateTime<Gregorian, Tcg> = From::from(now);
    println!("{}", now_gregorian_tcg);
}