Crate iso8601_interval

Source
Expand description

§Parsing ISO 8601 time interval into chrono DateTime

It is a small addition to the chrono crate, parsing ISO 8601 time interval 1 into IsoInterval which contains a pair of DateTime objects, that respectively mark the beginning and end of the interval.

This utility is missing in chrono possibly due to the fuzziness of duration, which can be specified against year and month, so the time passed is inherently not absolute. Intervals, on the other hand, are absolute in that regard, because when a starting or end point is fixed, the exact number of seconds passed can be calculated.

The dates, as parsed, are in chrono::FixedOffset time zone, and can be switched out by calling IsoInterval::with_time_zone.

Structs§

IsoDuration
Duration specified according to ISO 8601, in years, months, days, hours, minutes, and seconds. Seconds field can have fractional part, up to nanosecond precision.
IsoInterval
An interval in time.
ParseIntervalError
Error of parsing

Traits§

IsoDurationAddable
Things that can take durations for adding and subtracting.