winnow-iso8601, making parsing ISO8601 dates a breeze
Provides a set of complete parsers to deal with simple cases where you are parsing a stand-alone date string.
let datetime = iso8601::datetime("2015-06-26T16:43:23+0200").unwrap();
// the above will give you:
DateTime {
date: Date::YMD {
year: 2015,
month: 6,
day: 26,
},
time: Time {
hour: 16,
minute: 43,
second: 23,
tz_offset_hours: 2,
tz_offset_minutes: 0,
},
};
Each of these complete methods simply build a Partial<&[u8]>
which is flagged as complete. run the partial parsers
available. So, for most cases you would probably want to use:
winnow-iso8601 is the fruit of the work of many contributors over the years, many
thanks for your help! In particular, thanks to badboy
and hoodie for the original iso8601
crate and actually reading the standard.
Documentation is online.
MIT Licensed. See LICENSE