persian_date

Crates.iopersian_date
lib.rspersian_date
version1.0.1
sourcesrc
created_at2024-08-29 13:11:54.0114
updated_at2024-08-30 09:41:22.561009
descriptionPersian Date library for rust
homepagehttps://github.com/SudoDios/persian-date-rust
repositoryhttps://github.com/SudoDios/persian-date-rust
max_upload_size
id1356127
size34,024
Sudo Dios (SudoDios)

documentation

README

Persian Date (Rust)

Persian Date for Rust based on chrono date-time library

Installation

Add this dependency in your Cargo.toml file

[dependencies]
persian_date = "1.0.1"

Usage

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

Formatting

Date formatting in this library is similar to chrono

pdate.format("%Y-%m-%d %H:%M:%S") 
Commit count: 0

cargo fmt