aboutsummaryrefslogtreecommitdiff
path: root/dateutil/parser
diff options
context:
space:
mode:
authorCheuk Ho <cheuk@Cheuks-MBP.domain.name>2018-10-04 08:57:53 +0100
committerPaul Ganssle <paul@ganssle.io>2018-10-06 13:39:50 -0400
commit969d6bac84ca34276155d85c4943c3c736781187 (patch)
treec32f9defd0c71294022cbcb9f1026bb143c9ed1e /dateutil/parser
parent4e696bbeeb81e3d9078943500f648d845295c845 (diff)
downloaddateutil-969d6bac84ca34276155d85c4943c3c736781187.tar.gz
Accept 'z' for UTC in parser
Diffstat (limited to 'dateutil/parser')
-rw-r--r--dateutil/parser/_parser.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/dateutil/parser/_parser.py b/dateutil/parser/_parser.py
index 1cb592d..efb76fa 100644
--- a/dateutil/parser/_parser.py
+++ b/dateutil/parser/_parser.py
@@ -388,7 +388,8 @@ class parserinfo(object):
if res.year is not None:
res.year = self.convertyear(res.year, res.century_specified)
- if res.tzoffset == 0 and not res.tzname or res.tzname == 'Z':
+ if (res.tzoffset == 0 and not res.tzname or res.tzname == 'Z'
+ or res.tzname == 'z'):
res.tzname = "UTC"
res.tzoffset = 0
elif res.tzoffset != 0 and res.tzname and self.utczone(res.tzname):
@@ -1060,7 +1061,8 @@ class parser(object):
tzname is None and
tzoffset is None and
len(token) <= 5 and
- all(x in string.ascii_uppercase for x in token))
+ (all(x in string.ascii_uppercase for x in token)
+ or token in self.info.UTCZONE))
def _ampm_valid(self, hour, ampm, fuzzy):
"""