| Crates.io | persian_date |
| lib.rs | persian_date |
| version | 1.0.4 |
| created_at | 2024-08-29 13:11:54.0114+00 |
| updated_at | 2025-11-12 10:22:20.916658+00 |
| description | Persian Date library for rust |
| homepage | https://github.com/SudoDios/persian-date-rust |
| repository | https://github.com/SudoDios/persian-date-rust |
| max_upload_size | |
| id | 1356127 |
| size | 45,411 |
Persian Date for Rust based on chrono date-time library
Add this dependency in your Cargo.toml file
[dependencies]
persian_date = "1.0.4"
use persian_date::structure::PDate;
let pdate = PDate::now(); // initialize date
println!("{}",pdate); // formatted date
println!("{}",pdate.year()); // jalali year
println!("{}",pdate.month()); // jalali month
println!("{}",pdate.day()); // jalali day
println!("{}",pdate.day_of_week()); // day of week from saturday
// and more ...
Full documentation in docs.ir
Date formatting in this library is similar to chrono
pdate.format("%Y-%m-%d %H:%M:%S")