mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-10-20 12:23:16 +00:00
Allow for timestamps before UNIX epoch (#433)
This commit is contained in:
parent
d9ead81021
commit
5614dd5a89
1 changed files with 3 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue