1
0
mirror of https://github.com/bspeice/dtparse synced 2025-07-12 03:04:55 -04:00
This commit is contained in:
2020-06-11 12:49:55 -04:00
parent af6c3238c4
commit a08bb2d9d7
3 changed files with 32 additions and 3 deletions

View File

@ -347,7 +347,9 @@ impl ParserInfo {
res.year = Some(self.convertyear(y, res.century_specified))
};
if res.tzoffset == Some(0) && res.tzname.is_none() || res.tzname == Some("Z".to_owned()) {
if (res.tzoffset == Some(0) && res.tzname.is_none())
|| (res.tzname == Some("Z".to_owned()) || res.tzname == Some("z".to_owned()))
{
res.tzname = Some("UTC".to_owned());
res.tzoffset = Some(0);
} else if res.tzoffset != Some(0)
@ -885,7 +887,7 @@ impl Parser {
&& tzname.is_none()
&& tzoffset.is_none()
&& token.len() <= 5
&& all_ascii_upper
&& (all_ascii_upper || self.info.utczone.contains_key(token))
}
#[allow(clippy::unnecessary_unwrap)]