tempoch
ActiveAstronomical time types for Rust: Julian Date, MJD, UTC, TAI, GPS, and related conversions.
2 stars
0 forks
Rust
AGPL-3.0
Updated 1 weeks ago
Why it exists
tempoch keeps time scales explicit, so you do not have to guess what a timestamp means later. It provides the time layer shared across the Siderust crates.
Key Features
- Generic Time<S> instants by time-scale
- Built-in UTC ↔ TT/MJD conversion via chrono
- Automatic ΔT = TT − UT handling
- Period intervals with intersection / complement
- No-std compatible
Getting Started
# Add to your Cargo.toml
[dependencies]
tempoch = "0.6.4"
# Convert UTC to Julian Date
use chrono::Utc;
use tempoch::{JulianDate, MJD, Time};
let now_jd = JulianDate::from_utc(Utc::now());
let now_mjd: Time<MJD> = now_jd.to::<MJD>();
println!("JD(TT): {now_jd}");
println!("MJD(TT): {now_mjd}"); Contributing
We welcome contributions! Here's how you can help:
- 1 Fork the repository and create your branch from main
- 2 Make your changes and add tests if applicable
- 3 Ensure all tests pass with cargo test
- 4 Submit a pull request with a clear description
License
This project is licensed under the AGPL-3.0 license. See the LICENSE file for details.
Quick Links
Tags
time astronomy julian-date utc rust