Crates.io | html-datetime-local |
lib.rs | html-datetime-local |
version | 0.1.0 |
source | src |
created_at | 2023-12-18 16:23:02.172182 |
updated_at | 2023-12-18 16:23:02.172182 |
description | A Rust library for parsing local date and time strings based on the WHATWG HTML Living Standard. This may be helpful for server-side code that deals with values from input type=datetime-local |
homepage | https://github.com/tomsik68/html-datetime-local |
repository | https://github.com/tomsik68/html-datetime-local |
max_upload_size | |
id | 1073486 |
size | 20,396 |
html-datetime-local
is a Rust library for parsing local date and time strings based on the WHATWG HTML Living Standard.
This may be helpful for server-side code that deals with values from <input type="datetime-local" />
.
Add this to your Cargo.toml
:
[dependencies]
html-datetime-local = "0.1"
Then, in your Rust code:
use html_datetime_local::Datetime;
use std::str::FromStr;
let input = "2023-12-31T23:59:59";
match Datetime::from_str(input) {
Ok(datetime) => println!("Parsed datetime: {:?}", datetime),
Err(err) => eprintln!("Error parsing datetime: {}", err),
}
Pull requests and bug reports are welcome! If you have any questions or suggestions, feel free to open an issue.
This project is licensed under the MIT License - see the LICENSE file for details.
Special thanks to ChatGPT, an AI language model by OpenAI, for providing invaluable assistance during the development of this project. ChatGPT helped with code suggestions, problem-solving, and provided guidance throughout the development process.
License: MIT