mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-10-21 04:43:17 +00:00
Refine Timestamp APIs (#395)
This commit is contained in:
parent
aab29ff277
commit
887d3a7d22
3 changed files with 69 additions and 50 deletions
|
@ -691,9 +691,9 @@ class Unpacker(object):
|
|||
if n == -1: # timestamp
|
||||
ts = Timestamp.from_bytes(bytes(obj))
|
||||
if self._timestamp == 1:
|
||||
return ts.to_float()
|
||||
return ts.to_unix()
|
||||
elif self._timestamp == 2:
|
||||
return ts.to_unix_ns()
|
||||
return ts.to_unix_nano()
|
||||
elif self._timestamp == 3:
|
||||
return ts.to_datetime()
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue