summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--poezio/mam.py6
1 files changed, 5 insertions, 1 deletions
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)