Crate iso8601

source ·
Expand description

ISO8601 is a parser library for the ISO8601 format and partially RFC3339.

Validity of a given date is not guaranteed, this parser will happily parse "2015-02-29" as a valid date, even though 2015 was no leap year.

Example

let datetime = iso8601::datetime("2015-06-26T16:43:23+0200").unwrap();

Modules

The low-level parsers for date, datetime, duration and time.

Structs

Compound struct, holds Date and Time.
A time object.

Enums

A date, can hold three different formats.
A time duration. Durations: https://www.rfc-editor.org/rfc/rfc3339#page-13 dur-second = 1DIGIT “S” dur-minute = 1DIGIT “M” [dur-second] dur-hour = 1DIGIT “H” [dur-minute] dur-time = “T” (dur-hour / dur-minute / dur-second) dur-day = 1DIGIT “D” dur-week = 1DIGIT “W” dur-month = 1DIGIT “M” [dur-day] dur-year = 1*DIGIT “Y” [dur-month] dur-date = (dur-day / dur-month / dur-year) [dur-time] duration = “P” (dur-date / dur-time / dur-week)

Functions

Parses a date string.
Parses a datetime string.
Parses a duration string.
Parses a time string.