#date-time

fuzzydate

A flexible natural language date parsing library

11 releases

0.3.1 Nov 27, 2025
0.3.0 Nov 26, 2025
0.2.3 Mar 9, 2025
0.2.2 Dec 27, 2023
0.1.5 Feb 18, 2022

#47 in Date and time

Download history 218/week @ 2025-10-02 577/week @ 2025-10-09 360/week @ 2025-10-16 422/week @ 2025-10-23 505/week @ 2025-10-30 394/week @ 2025-11-06 906/week @ 2025-11-13 842/week @ 2025-11-20 625/week @ 2025-11-27 679/week @ 2025-12-04 677/week @ 2025-12-11 893/week @ 2025-12-18 226/week @ 2025-12-25 123/week @ 2026-01-01 970/week @ 2026-01-08 81/week @ 2026-01-15

1,410 downloads per month
Used in 8 crates (4 directly)

MIT license

85KB
2K SLoC

fuzzydate

fuzzydate on crates.io fuzzydate on docs.rs

fuzzydate parses human-friendly date/time phrases (for example: "five days after this Friday", "tomorrow at noon", "3 weeks ago") and returns chrono datetimes. The current time (or a passed alternative), is used for any values not specified by the phrase and for any operations that are relative to an existing time, like 5 days ago. By default, fuzzydate uses the current time and system timezone.

Install

Add to your Cargo.toml:

[dependencies]
fuzzydate = "0.3"

Examples

For full grammar reference, see the documentation.

use fuzzydate::parse;

fn main() -> Result<(), fuzzydate::Error> {
    let dt = parse("five days after this friday")?;
    println!("{:?}", dt);
    Ok(())
}

Additional functions are available to parse datetimes with an alternative current time and parse in a timezone other than the system timezone:

use fuzzydate::aware_parse;
use chrono::offset::Utc;
use chrono::prelude::*;

fn main() -> Result<(), fuzzydate::Error> {
    let dt = aware_parse("tomorrow at noon", Utc::now(), Utc)?;
    println!("{}", dt);
    Ok(())
}

Dependencies

~1–2MB
~34K SLoC