Use correct file date on Jingle FT
- XEP-0234 demands UTC - we missed the 'Z' at the end - simplified the code
This commit is contained in:
parent
a2e2fb2ed1
commit
1eeb53bee6
1 changed files with 3 additions and 5 deletions
|
@ -30,6 +30,7 @@ import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from enum import IntEnum, unique
|
from enum import IntEnum, unique
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
import gtkgui_helpers
|
import gtkgui_helpers
|
||||||
import tooltips
|
import tooltips
|
||||||
|
@ -682,11 +683,8 @@ class FileTransfersWindow:
|
||||||
|
|
||||||
def __convert_date(self, epoch):
|
def __convert_date(self, epoch):
|
||||||
# Converts date-time from seconds from epoch to iso 8601
|
# Converts date-time from seconds from epoch to iso 8601
|
||||||
import time, datetime
|
dt = datetime.utcfromtimestamp(epoch)
|
||||||
ts = time.gmtime(epoch)
|
return dt.isoformat() + 'Z'
|
||||||
dt = datetime.datetime(ts.tm_year, ts.tm_mon, ts.tm_mday, ts.tm_hour,
|
|
||||||
ts.tm_min, ts.tm_sec)
|
|
||||||
return dt.isoformat()
|
|
||||||
|
|
||||||
def get_send_file_props(self, account, contact, file_path, file_name,
|
def get_send_file_props(self, account, contact, file_path, file_name,
|
||||||
file_desc=''):
|
file_desc=''):
|
||||||
|
|
Loading…
Add table
Reference in a new issue