From 1eeb53bee6cebc3ce56ee7b8bb01e7058e6cabd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Mon, 7 Aug 2017 13:03:48 +0200 Subject: [PATCH] Use correct file date on Jingle FT - XEP-0234 demands UTC - we missed the 'Z' at the end - simplified the code --- gajim/filetransfers_window.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gajim/filetransfers_window.py b/gajim/filetransfers_window.py index 7d1ab5483..bb50f5d25 100644 --- a/gajim/filetransfers_window.py +++ b/gajim/filetransfers_window.py @@ -30,6 +30,7 @@ import os import time from enum import IntEnum, unique +from datetime import datetime import gtkgui_helpers import tooltips @@ -682,11 +683,8 @@ class FileTransfersWindow: def __convert_date(self, epoch): # Converts date-time from seconds from epoch to iso 8601 - import time, datetime - ts = time.gmtime(epoch) - dt = datetime.datetime(ts.tm_year, ts.tm_mon, ts.tm_mday, ts.tm_hour, - ts.tm_min, ts.tm_sec) - return dt.isoformat() + dt = datetime.utcfromtimestamp(epoch) + return dt.isoformat() + 'Z' def get_send_file_props(self, account, contact, file_path, file_name, file_desc=''):