#date-time

fuzzydate

A flexible natural language date parsing library

13 unstable releases (3 breaking)

0.4.1 Apr 5, 2026
0.4.0 Feb 4, 2026
0.3.1 Nov 27, 2025
0.2.3 Mar 9, 2025
0.1.5 Feb 18, 2022

#39 in Date and time

Download history 68/week @ 2026-01-21 628/week @ 2026-01-28 975/week @ 2026-02-04 549/week @ 2026-02-11 469/week @ 2026-02-18 361/week @ 2026-02-25 6030/week @ 2026-03-04 10697/week @ 2026-03-11 12639/week @ 2026-03-18 12355/week @ 2026-03-25 11243/week @ 2026-04-01 10769/week @ 2026-04-08 7396/week @ 2026-04-15 2560/week @ 2026-04-22 5170/week @ 2026-04-29 6154/week @ 2026-05-06

22,484 downloads per month
Used in 9 crates (5 directly)

MIT license

105KB
2.5K 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.4"

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–1.8MB
~31K SLoC