mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-07 02:09:59 +00:00
Have unpacked datetime timezone being local
This commit is contained in:
parent
19b5d33ded
commit
3715b72d57
2 changed files with 5 additions and 2 deletions
|
|
@ -157,9 +157,10 @@ class Timestamp:
|
|||
:rtype: `datetime.datetime`
|
||||
"""
|
||||
utc = datetime.timezone.utc
|
||||
return datetime.datetime.fromtimestamp(0, utc) + datetime.timedelta(
|
||||
utcDatetime = datetime.datetime.fromtimestamp(0, utc) + datetime.timedelta(
|
||||
seconds=self.seconds, microseconds=self.nanoseconds // 1000
|
||||
)
|
||||
return utcDatetime.astimezone(tz=None)
|
||||
|
||||
@staticmethod
|
||||
def from_datetime(dt):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue