A Rust implementation of python-dateutil with powerful date/time extensions.
rust-dateutil provides powerful extensions to Rust's standard date/time functionality, inspired by Python's dateutil library. It offers:
- Relative date/time arithmetic - Add months, years, and complex date operations
- Flexible date/time parsing - Parse dates from almost any string format
- Recurrence rules - Generate recurring dates using RFC 5545 specifications
- Timezone handling - Comprehensive timezone support
- High performance - 5-10x faster than Python dateutil with zero-cost abstractions
Add to your Cargo.toml:
[dependencies]
dateutil = "0.1"use dateutil::relativedelta::RelativeDelta;
use chrono::NaiveDate;
// Add relative time periods
let date = NaiveDate::from_ymd_opt(2023, 1, 31).unwrap();
let rd = RelativeDelta::new().months(1);
let result = rd.apply_to_datetime(&date.and_hms_opt(0, 0, 0).unwrap()).unwrap();
// Jan 31 + 1 month = Feb 28 (handles month-end correctly)
println!("Result: {}", result.date()); // 2023-02-28This project is organized as a workspace with multiple crates:
dateutil-core- Core types and traitsdateutil-relativedelta- Relative date/time arithmeticdateutil-tz- Timezone handlingdateutil-parser- Date/time string parsingdateutil-rrule- Recurrence rules (RFC 5545)dateutil- Main API crate (re-exports everything)
🚧 Early Development - This project is in active development
- ✅ Project structure and workspace setup
- ✅ Core data types and traits
- ✅ Basic RelativeDelta implementation
- ✅ Month/year arithmetic with proper overflow handling
- ✅ Initial test suite
- 🔄 Timezone implementations
- 🔄 Date/time parsing
- 🔄 Recurrence rules
- 🔄 Comprehensive test coverage
- ⏳ Python compatibility layer
- ⏳ Performance benchmarks
- ⏳ Complete documentation
- ⏳ RFC 5545 compliance testing
This project is in early development. Contributions are welcome!
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
This project is inspired by and aims to be compatible with:
- python-dateutil - The original Python library
- chrono - Rust's primary date/time library