tlobject: Represent timestamp as 'int' instead of 'float'

This commit is contained in:
Dmitry D. Chernov 2017-11-23 22:39:35 +10:00
parent f99d14558f
commit 5a4d6d4a57

View File

@ -36,7 +36,9 @@ class TLObject:
', '.join(TLObject.pretty_format(x) for x in obj)
)
elif isinstance(obj, datetime):
return 'datetime.utcfromtimestamp({})'.format(obj.timestamp())
return 'datetime.utcfromtimestamp({})'.format(
int(obj.timestamp())
)
else:
return repr(obj)
else:
@ -82,7 +84,7 @@ class TLObject:
elif isinstance(obj, datetime):
result.append('datetime.utcfromtimestamp(')
result.append(repr(obj.timestamp()))
result.append(repr(int(obj.timestamp())))
result.append(')')
else: