Ignore negative epoch values

This commit is contained in:
Tomme 2019-03-24 19:31:30 +00:00
parent 49d6314426
commit bcd81e67c0

View file

@ -181,7 +181,7 @@ def toDatetime(value, format=None):
# https://bugs.python.org/issue30684
# And platform support for before epoch seems to be flaky.
# TODO check for others errors too.
if int(value) == 0:
if int(value) <= 0:
value = 86400
value = datetime.fromtimestamp(int(value))
return value