diff --git a/src/yunohost/app.py b/src/yunohost/app.py index e107d7ac9..0664a24b2 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -1762,8 +1762,7 @@ def _get_app_status(app_id, format_date=False): if not v: status[f] = '-' else: - status[f] = time.strftime(m18n.n('format_datetime_short'), - time.gmtime(v)) + status[f] = datetime.utcfromtimestamp(v).replace(tzinfo=pytz.utc) return status diff --git a/src/yunohost/backup.py b/src/yunohost/backup.py index 6ef9a0554..492687eaf 100644 --- a/src/yunohost/backup.py +++ b/src/yunohost/backup.py @@ -33,6 +33,8 @@ import shutil import subprocess import csv import tempfile +import pytz +from datetime import datetime from glob import glob from collections import OrderedDict @@ -2266,8 +2268,8 @@ def backup_info(name, with_details=False, human_readable=False): result = { 'path': archive_file, - 'created_at': time.strftime(m18n.n('format_datetime_short'), - time.gmtime(info['created_at'])), + 'created_at': datetime.utcfromtimestamp(info['created_at']) + .replace(tzinfo=pytz.utc), 'description': info['description'], 'size': size, } diff --git a/src/yunohost/settings.py b/src/yunohost/settings.py index d2526316e..3227ad3e3 100644 --- a/src/yunohost/settings.py +++ b/src/yunohost/settings.py @@ -154,7 +154,7 @@ def settings_reset_all(): # addition but we'll see if this is a common need. # Another solution would be to use etckeeper and integrate those # modification inside of it and take advantage of its git history - old_settings_backup_path = SETTINGS_PATH_OTHER_LOCATION % datetime.now().strftime("%F_%X") + old_settings_backup_path = SETTINGS_PATH_OTHER_LOCATION % datetime.utcnow().strftime("%F_%X") _save_settings(settings, location=old_settings_backup_path) for value in settings.values():