mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-04-20 17:11:59 +03:00
One small change to serialize_datetime
This commit is contained in:
parent
2776df5192
commit
9e0dd88d6d
|
@ -132,11 +132,11 @@ class TLObject:
|
|||
elif isinstance(dt, float):
|
||||
dt = int(dt)
|
||||
elif isinstance(dt, timedelta):
|
||||
dt = int(dt.total_seconds())
|
||||
dt = int((datetime.now() + dt).timestamp())
|
||||
except OSError:
|
||||
dt = 0
|
||||
|
||||
# 2145916800 is the date 2038, 1, 1.
|
||||
# 2145916800 is the date 2038-01-01.
|
||||
if dt > 2145916800:
|
||||
raise ValueError("Date is outside the range of valid values.")
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user