iso8601_interval

Crates.ioiso8601_interval
lib.rsiso8601_interval
version0.3.0
sourcesrc
created_at2023-03-29 23:24:52.856343
updated_at2023-07-22 16:41:08.644879
descriptionParses ISO8601 time intervals.
homepagehttps://github.com/PowerSnail/iso8601_interval
repositoryhttps://github.com/PowerSnail/iso8601_interval
max_upload_size
id824514
size20,805
Power Snail (PowerSnail)

documentation

README

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.

Interval is 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 FixedOffset time zone, and can be switched out by calling [IsoInterval::with_time_zone].

Footnotes

  1. https://en.wikipedia.org/wiki/ISO_8601#Time_intervals

Commit count: 11

cargo fmt