Skip to main content

parse_date_range

Function parse_date_range 

Source
pub fn parse_date_range(input: &str) -> Result<(i64, i64), DateRangeParseError>
Expand description

Parse a date range string into start/end timestamps

Supported formats:

  • Absolute: “2024-01-01 to 2024-12-31”, “2024-01-01..2024-12-31”
  • Relative: “last 30 days”, “last 6 months”, “last 1 year”
  • Presets: “YTD”, “MTD”, “1M”, “3M”, “6M”, “1Y”, “5Y”, “MAX”

Returns (start_timestamp, end_timestamp) in Unix seconds