use 'utcfromtimestamp()'

'fromtimestamp()' converts its results to the local timezone and causes
problems when running tests on a different machine.
This commit is contained in:
Mike Fährmann
2019-04-21 16:22:53 +02:00
parent d84e7c6861
commit 6264a46212
3 changed files with 6 additions and 6 deletions

View File

@@ -218,7 +218,7 @@ def parse_query(qs):
def parse_timestamp(ts, default=None):
"""Create a datetime object from a unix timestamp"""
try:
return datetime.datetime.fromtimestamp(int(ts))
return datetime.datetime.utcfromtimestamp(int(ts))
except (TypeError, ValueError, OverflowError):
return default