Skip to main content

parse_since_duration

Function parse_since_duration 

Source
pub fn parse_since_duration(s: &str) -> Result<String>
Expand description

Parse a human-readable duration string into an RFC3339 timestamp representing now - duration.

Supported suffixes:

  • d — days (e.g. "7d")
  • h — hours (e.g. "24h")
  • m — minutes (e.g. "30m")

Returns an ISO8601/RFC3339 string suitable for comparison against control_messages.created_at (stored as UTC RFC3339).

Returns Err if the format is unrecognised or the number overflows.