Merge pull request #345 from Tomme/ignore_negative_epoch_values

Ignore negative epoch values
This commit is contained in:
Michael Shepanski 2019-05-29 12:50:38 -04:00 committed by GitHub
commit e81809464f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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