diff --git a/src/format/mod.rs b/src/format/mod.rs index a21ffe81f5..ed65d9228f 100644 --- a/src/format/mod.rs +++ b/src/format/mod.rs @@ -221,7 +221,6 @@ pub enum Fixed { TimezoneOffsetColon, /// Offset from the local time to UTC with seconds (`+09:00:00` or `-04:00:00` or `+00:00:00`). /// - /// In the parser, the colon can be omitted and/or surrounded with any amount of whitespace. /// The offset is limited from `-24:00:00` to `+24:00:00`, /// which is the same as [`FixedOffset`](../offset/struct.FixedOffset.html)'s range. TimezoneOffsetDoubleColon, diff --git a/src/format/parse.rs b/src/format/parse.rs index 8cf14337ec..b675f97f3a 100644 --- a/src/format/parse.rs +++ b/src/format/parse.rs @@ -526,7 +526,6 @@ where } &TimezoneOffsetColon - | &TimezoneOffsetDoubleColon | &TimezoneOffset | &TimezoneOffsetColonZ | &TimezoneOffsetZ => { @@ -540,6 +539,17 @@ where parsed.set_offset(i64::from(offset)).map_err(|e| (s, e))?; } + &TimezoneOffsetDoubleColon => { + let offset_format = OffsetFormat { + precision: OffsetPrecision::Seconds, + colons: Colons::Colon, + allow_zulu: false, + padding: Pad::Zero, + }; + let offset = try_consume!(scan::utc_offset(s.trim_start(), offset_format)); + parsed.set_offset(i64::from(offset)).map_err(|e| (s, e))?; + } + &TimezoneOffsetTripleColon => { let offset_format = OffsetFormat { precision: OffsetPrecision::Hours,