| Crates.io | readable_time |
| lib.rs | readable_time |
| version | 0.1.3 |
| created_at | 2025-11-30 03:02:34.174234+00 |
| updated_at | 2025-12-09 12:22:29.239174+00 |
| description | Quick and easy date and time lib to get the job done. |
| homepage | |
| repository | https://github.com/BayonetArch/readable_time |
| max_upload_size | |
| id | 1957779 |
| size | 9,527 |
A lightweight and non crate dependent rust library for date and time.
This library is for simple use cases and doesnot provide advanced time functionality.
I created it cause chrono' was too heavy for my use case.
Add from crates.io:
cargo add readable_time
OR
cargo add --git https://github.com/BayonetArch/readable_time
let rt:ReadableTime = get_readable_time()?;
// You can use rt.month,rt.year,rt.day,rt.hour_24,rt.hour_12,......
// Or specific method to get formatted_time like 'rt.get_timef()' 'rt.get_ptimef',....
println!("{}",rt.get_timef()); // OUTPUT: 2025-01-01 03:04:05
println!("{}",rt.get_ptimef()?); // OUTPUT: Mon Jan 15 2024 03:45 PM
println!("{}",rt.get_extended_ptimef()?); // OUTPUT: Sun Nov 30 07:14:00 +0545 2025
If you want to get the time period for 'hour_24' you can use :
ReadableTime::get_time_period(hour_24)?; // "AM" or "PM"
This library works on unix systems and is not guaranted to work on windows(who gives an flip anyway right?)