| Crates.io | dayjs |
| lib.rs | dayjs |
| version | 0.1.9 |
| created_at | 2024-10-24 04:35:23.073898+00 |
| updated_at | 2025-08-29 08:37:36.237743+00 |
| description | a date and time library for Rust, inspired by day.js |
| homepage | |
| repository | https://github.com/guobin211/dayjs |
| max_upload_size | |
| id | 1420854 |
| size | 30,239 |
A Rust library providing a JavaScript Day.js-like API for date and time manipulation, built on top of chrono.
chrono for high performanceAdd this to your Cargo.toml:
[dependencies]
dayjs = "^0.1"
fn main() {
// current date and time
let now = dayjs::now();
// Create and manipulate dates
let mut date = dayjs::from_str("2025-01-25T10:30:45Z").unwrap();
// Add 30 days
date.add_days(30);
// Format output
println!("ISO: {}", date.to_iso());
println!("Custom: {}", date.format("%Y年%m月%d日 %H:%M:%S"));
}