A friendly Rust utility crate for duration and datetime
Last updated Apr 7, 2026
39
Stars
0
Forks
2
Issues
0
Stars/day
Attention Score
5
Language breakdown
Rust 100.0%
โธ Files
click to expand
README
Aion 
Aion is a utility crate, inspired by rails, that allows you to write Duration and DateTime in a friendly way:
// Easily represent a chrono::Duration
let two_days = 2.days();
let attention_span = 1.seconds();
// Add or subtract durations from the current time (UTC) let now = Utc::now(); let threehoursfrom_now = now + 3.hours(); let twohoursfromnow = 2.hours().fromnow(); let last_week = 7.days().ago(); // or 1.weeks().ago()
// More complex DateTimes can be represented using before() and after() methods let christmas = Utc.ymd(2020, 12, 25).and_hms(0, 0, 0); let twoweeksbefore_christmas = 2.weeks().before(christmas); let boxing_day = 1.days().after(christmas);
Installation
Add this to yourCargo.toml file:
[dependencies]
aion = "0.2"
Example
The example is located inexample folder. You can run it by using
cargo run --example example
Limitations
Currently this crate only will returnDateTime<Utc>.
Acknowledgement
This crate is using chrono. Thanks for this awesome crate.๐ More in this category