Crates.io | dtinfer |
lib.rs | dtinfer |
version | 0.1.1 |
source | src |
created_at | 2020-10-12 20:18:14.337118 |
updated_at | 2020-10-13 09:35:35.682162 |
description | Infer DateTime format |
homepage | https://github.com/klangner/dtinfer.rs |
repository | https://github.com/klangner/dtinfer.rs |
max_upload_size | |
id | 298888 |
size | 22,804 |
Library for infering date time format from the given string.
Add dependency to your project
dfinfer = "0.1"
And then:
use dtinfer;
let pattern = infer_best("2020-10-09 15:24:50+00:00").unwrap();
assert_eq!(pattern, "%Y-%m-%d %H:%M:%S%z")
Only ISO 8601 like dates are supported as for now. Check tests for examples.
Licensed under either of
at your option.
Contributions
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.