Crate htp[][src]

Expand description

HTP

(H)uman (T)ime (P)arser.

Example

use chrono::{Utc, TimeZone};
use htp::parse;
let now = Utc.datetime_from_str("2020-12-24T23:45:00", "%Y-%m-%dT%H:%M:%S").unwrap();
let expected = Utc.datetime_from_str("2020-12-18T19:43:00", "%Y-%m-%dT%H:%M:%S").unwrap();
let datetime = parse("last friday at 19:43", now).unwrap();
assert_eq!(datetime, expected);

Modules

Enums

Functions

Same as parse_time_clue(s, now, false)

Parse time clue from s given reference time now in timezone Tz.