Function chrono::format::scan::timezone_offset
source · pub(crate) fn timezone_offset<F>(
s: &str,
consume_colon: F,
allow_zulu: bool,
allow_missing_minutes: bool,
allow_tz_minus_sign: bool,
) -> ParseResult<(&str, i32)>
Expand description
Parse a timezone from s
and return the offset in seconds.
The consume_colon
function is used to parse a mandatory or optional :
separator between hours offset and minutes offset.
The allow_missing_minutes
flag allows the timezone minutes offset to be
missing from s
.
The allow_tz_minus_sign
flag allows the timezone offset negative character
to also be −
MINUS SIGN (U+2212) in addition to the typical
ASCII-compatible -
HYPHEN-MINUS (U+2D).
This is part of RFC 3339 & ISO 8601.