1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 08:17:13 +03:00

Check time-of-day in locale-independent way

This commit is contained in:
Jonathan Harris 2017-08-16 00:33:10 +01:00
parent e86d915b04
commit 374db8ae23

View File

@ -84,7 +84,7 @@ class EDDN:
# Assumes that the gateway returns a strictly compliant Date - https://tools.ietf.org/html/rfc7231#section-7.1.1.1
try:
r = self.session.get(self.HEALTH, timeout=timeout)
return timegm(time.strptime(r.headers['Date'], "%a, %d %b %Y %H:%M:%S GMT"))
return timegm(time.strptime(r.headers['Date'].split(',')[1].strip(), "%d %b %Y %H:%M:%S GMT"))
except:
# On any error assume that we're good
if __debug__: print_exc()