From 241f026ccfd46b946bd2386aff4453c219f7630e Mon Sep 17 00:00:00 2001 From: Madhur Garg Date: Sat, 13 Jul 2019 13:40:51 +0530 Subject: Fixed timestamp --- poezio/mam.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/poezio/mam.py b/poezio/mam.py index 21917c8e..a6cd05f6 100644 --- a/poezio/mam.py +++ b/poezio/mam.py @@ -19,9 +19,10 @@ def add_line(text_buffer: TextBuffer, text: str, str_time: str, nick: str, top: if '/' in nick: nick = nick.split('/')[1] color = get_theme().COLOR_OWN_NICK + time = time.replace(tzinfo=timezone.utc).astimezone(tz=None) + time = time.replace(tzinfo=None) else: color = get_theme().COLOR_ME_MESSAGE - top = top text_buffer.add_message( text, time, @@ -88,6 +89,9 @@ def mam_scroll(self): if time < end: end = time end = end + timedelta(seconds=-1) + tzone = datetime.now().astimezone().tzinfo + end = end.replace(tzinfo=tzone).astimezone(tz=timezone.utc) + end = end.replace(tzinfo=None) end = datetime.strftime(end, '%Y-%m-%dT%H:%M:%SZ') start = datetime.strptime(end, '%Y-%m-%dT%H:%M:%SZ') start = start + timedelta(days=-360) -- cgit v1.2.3