Skip to main content

parse_relative_time

Function parse_relative_time 

Source
pub fn parse_relative_time(expression: &str) -> Result<String>
Expand description

Parse a relative or absolute time expression into RFC3339.

Supports:

  • RFC3339 timestamps (2026-02-01T09:00:00Z)
  • Relative expressions: “tomorrow 9am”, “in 2 hours”, “next monday”

Time parsing for expressions like “tomorrow 9am” uses a simple heuristic:

  • “9am”, “9:00am”, “09:00” formats are supported
  • If no time is specified, defaults to 9:00 AM