mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-04-20 17:11:59 +03:00
Fix serialize_datetime (edits)
Forgot to wrap timedelta's seconds in `int()` on L135.
This commit is contained in:
parent
e65b7b0fd1
commit
be6bb94e00
|
@ -123,6 +123,7 @@ class TLObject:
|
|||
if not dt and not isinstance(dt, timedelta):
|
||||
return b'\0\0\0\0'
|
||||
|
||||
# We should use the time zone of the user.
|
||||
try:
|
||||
if isinstance(dt, datetime):
|
||||
dt = int(dt.timestamp())
|
||||
|
@ -131,7 +132,7 @@ class TLObject:
|
|||
elif isinstance(dt, float):
|
||||
dt = int(dt)
|
||||
elif isinstance(dt, timedelta):
|
||||
dt = dt.total_seconds()
|
||||
dt = int(dt.total_seconds())
|
||||
except OSError:
|
||||
dt = 0
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user