Allow for timestamps before UNIX epoch (#433)

This commit is contained in:
Tom Pohl 2020-07-23 10:53:55 +02:00 committed by GitHub
parent d9ead81021
commit 5614dd5a89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -178,7 +178,9 @@ class Timestamp(object):
:rtype: datetime.
"""
return datetime.datetime.fromtimestamp(self.to_unix(), _utc)
return datetime.datetime.fromtimestamp(0, _utc) + datetime.timedelta(
seconds=self.to_unix()
)
@staticmethod
def from_datetime(dt):