mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-06-19 06:02:09 +00:00
Fix Timestamp.from_datetime returning wrong value for pre-epoch datetimes (#662)
This commit is contained in:
parent
b83a0aa62b
commit
98d2c7907d
2 changed files with 8 additions and 1 deletions
|
|
@ -167,4 +167,4 @@ class Timestamp:
|
|||
|
||||
:rtype: Timestamp
|
||||
"""
|
||||
return Timestamp(seconds=int(dt.timestamp()), nanoseconds=dt.microsecond * 1000)
|
||||
return Timestamp(seconds=int(dt.timestamp() // 1), nanoseconds=dt.microsecond * 1000)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue