mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-18 02:56:39 +00:00
tlobject: Represent timestamp as 'int' instead of 'float'
This commit is contained in:
parent
f99d14558f
commit
5a4d6d4a57
@ -36,7 +36,9 @@ class TLObject:
|
|||||||
', '.join(TLObject.pretty_format(x) for x in obj)
|
', '.join(TLObject.pretty_format(x) for x in obj)
|
||||||
)
|
)
|
||||||
elif isinstance(obj, datetime):
|
elif isinstance(obj, datetime):
|
||||||
return 'datetime.utcfromtimestamp({})'.format(obj.timestamp())
|
return 'datetime.utcfromtimestamp({})'.format(
|
||||||
|
int(obj.timestamp())
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
return repr(obj)
|
return repr(obj)
|
||||||
else:
|
else:
|
||||||
@ -82,7 +84,7 @@ class TLObject:
|
|||||||
|
|
||||||
elif isinstance(obj, datetime):
|
elif isinstance(obj, datetime):
|
||||||
result.append('datetime.utcfromtimestamp(')
|
result.append('datetime.utcfromtimestamp(')
|
||||||
result.append(repr(obj.timestamp()))
|
result.append(repr(int(obj.timestamp())))
|
||||||
result.append(')')
|
result.append(')')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user