Infer DateTime format

Build Status Crates.io Crates.io docs.rs

Library for infering date time format from the given string.

Example

```rust use dtinfer; use chrono::{NaiveDate, NaiveTime, NaiveDateTime};

let sample = "1987-05-23T12:30"; let pattern = dtinfer::inferbest(sample).unwrap(); let parsed = NaiveDateTime::parsefromstr(sample, &pattern).unwrap(); let expected = NaiveDateTime::new(NaiveDate::fromymd(1987, 5, 23), NaiveTime::fromhms(12, 30, 0)); asserteq!(parsed, expected); ```

Features

Only ISO 8601 like date are supported as for now.

License

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.