diff --git a/telethon/tl/tlobject.py b/telethon/tl/tlobject.py index 2ba6ef14..68c5e741 100644 --- a/telethon/tl/tlobject.py +++ b/telethon/tl/tlobject.py @@ -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: