Ext Time
A Rust library providing extension traits for time manipulation, built on top of the time crate.
Features
- Extension traits for
TimeandOffsetDateTime - Time formatting and parsing utilities
- Time alignment and rounding functions
- Time arithmetic operations
- Timezone handling
- Date boundary calculations (start/end of day, week, month)
Usage
Add this to your Cargo.toml:
[]
= "0.1.0"
Examples
use ;
use ;
// Time operations
let time = from_hms.unwrap;
let next_hour = time.next_hour;
let aligned = time.align_to.unwrap; // Align to 5 minutes
// DateTime operations
let dt = now_utc;
let start_of_day = dt.start_of_day;
let end_of_month = dt.end_of_month;
License
MIT