mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-25 19:03:46 +03:00
Load update state date with explicit timezone (#808)
This commit is contained in:
parent
051d56af88
commit
dc3d281274
|
@ -211,7 +211,8 @@ class SQLiteSession(MemorySession):
|
||||||
'where id = ?', entity_id)
|
'where id = ?', entity_id)
|
||||||
if row:
|
if row:
|
||||||
pts, qts, date, seq = row
|
pts, qts, date, seq = row
|
||||||
date = datetime.datetime.utcfromtimestamp(date)
|
date = datetime.datetime.fromtimestamp(
|
||||||
|
date, tz=datetime.timezone.utc)
|
||||||
return types.updates.State(pts, qts, date, seq, unread_count=0)
|
return types.updates.State(pts, qts, date, seq, unread_count=0)
|
||||||
|
|
||||||
def set_update_state(self, entity_id, state):
|
def set_update_state(self, entity_id, state):
|
||||||
|
|
|
@ -65,11 +65,6 @@ class TLObject:
|
||||||
result.append('\t' * indent)
|
result.append('\t' * indent)
|
||||||
result.append(']')
|
result.append(']')
|
||||||
|
|
||||||
elif isinstance(obj, datetime):
|
|
||||||
result.append('datetime.utcfromtimestamp(')
|
|
||||||
result.append(repr(int(obj.timestamp())))
|
|
||||||
result.append(')')
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
result.append(repr(obj))
|
result.append(repr(obj))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user