Skip to content

Commit

Permalink
refine parse_date
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyoufu authored and defnull committed Dec 19, 2019
1 parent 9f81b80 commit 73ffcce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bottle.py
Expand Up @@ -2980,7 +2980,7 @@ def parse_date(ims):
""" Parse rfc1123, rfc850 and asctime timestamps and return UTC epoch. """
try:
ts = email.utils.parsedate_tz(ims)
return time.mktime(ts[:8] + (0, )) - (ts[9] or 0) - time.timezone
return calendar.timegm(ts[:8] + (0, )) - (ts[9] or 0)
except (TypeError, ValueError, IndexError, OverflowError):
return None

Expand Down

0 comments on commit 73ffcce

Please sign in to comment.