Skip to main content

Module timerange

Module timerange 

Source
Expand description

Time-range parsing in the user’s local timezone.

Mail ranges look backward from “now” (Direction::Past); calendar ranges look forward (Direction::Future). Named ranges (today, this_week, …) and explicit from/to bounds are always resolved against the caller-supplied IANA timezone, then converted to UTC.

Enums§

Direction
Whether a bare Nd range (e.g. 3d) looks backward from now (mail) or forward from now (calendar).

Functions§

parse_point
Parse a single timestamp: RFC 3339, a naive YYYY-MM-DDTHH:MM:SS or YYYY-MM-DDTHH:MM (interpreted in tz), or a bare YYYY-MM-DD date (interpreted as local midnight, or the following local midnight when end_of_day is set, making the date inclusive).
parse_range
Resolve a named range, an Nd range, or explicit from/to bounds into a (start, end) UTC pair.