4 releases (breaking)

0.4.0 Dec 29, 2023
0.3.0 Nov 15, 2021
0.2.0 Nov 10, 2021
0.1.0 Nov 10, 2021

#91 in Date and time

Download history 13/week @ 2023-12-21 34/week @ 2023-12-28 3/week @ 2024-01-04 8/week @ 2024-01-11 2/week @ 2024-01-18 4/week @ 2024-02-01 7/week @ 2024-02-08 25/week @ 2024-02-15 56/week @ 2024-02-22 39/week @ 2024-02-29 68/week @ 2024-03-07 30/week @ 2024-03-14 31/week @ 2024-03-21 46/week @ 2024-03-28 25/week @ 2024-04-04

143 downloads per month
Used in 6 crates (5 directly)

MIT/Apache

37KB
723 lines

anydate   Latest Version

This crate is used to parse an unknown DateTime or Date format into a normalized version.


Any significant changes to anydate are documented in the CHANGELOG.md file.

Usage

[dependencies]
anydate = "0.4"

Features

Optional features:

  • serde: Enable deserialize_with helper functions via serde.

Example usages

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // see parse_utc() for convenience conversion to UTC
    let parsed = anydate::parse("2021-11-10T03:25:06.533447000Z");
    println!("{:#?}", parsed);
    Ok(())
}

or if you know it's only a date with no time component

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let parsed = anydate::date::parse("2021-11-10");
    println!("{:#?}", parsed);
    Ok(())
}

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Proteus by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~1.2–2MB
~37K SLoC