summaryrefslogtreecommitdiff
path: root/poezio/mam.py
diff options
context:
space:
mode:
authorMadhur Garg <madhurgarg96@gmail.com>2019-07-13 13:40:51 +0530
committerMadhur Garg <madhurgarg96@gmail.com>2019-08-22 00:54:25 +0530
commit241f026ccfd46b946bd2386aff4453c219f7630e (patch)
tree36610f99fe2eb319e79158958801823ac7fdf146 /poezio/mam.py
parent0c22a856269b2a4c8ed014a2fb328b80c32a73d1 (diff)
downloadpoezio-241f026ccfd46b946bd2386aff4453c219f7630e.tar.gz
poezio-241f026ccfd46b946bd2386aff4453c219f7630e.tar.bz2
poezio-241f026ccfd46b946bd2386aff4453c219f7630e.tar.xz
poezio-241f026ccfd46b946bd2386aff4453c219f7630e.zip
Fixed timestamp
Diffstat (limited to 'poezio/mam.py')
-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)