1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-20 13:50:12 +01:00

convert apk timestamp from filesystem to utc before storing

This commit is contained in:
Michael Pöhn 2017-08-31 11:46:12 +02:00
parent 50c17f99d1
commit 290b9050e0
2 changed files with 2 additions and 2 deletions

View File

@ -1686,7 +1686,6 @@ class KnownApks:
if apkName not in self.apks:
if default_date is None:
default_date = datetime.utcnow()
default_date = datetime(default_date.year, default_date.month, default_date.day, 0, 0, 0, 0)
self.apks[apkName] = (app, default_date)
self.changed = True
_, added = self.apks[apkName]

View File

@ -28,6 +28,7 @@ import socket
import zipfile
import hashlib
import pickle
import time
from datetime import datetime, timedelta
from argparse import ArgumentParser
@ -930,7 +931,7 @@ def scan_repo_files(apkcache, repodir, knownapks, use_date_from_file=False):
if use_date_from_file:
timestamp = stat.st_ctime
default_date_param = datetime.fromtimestamp(timestamp).utctimetuple()
default_date_param = time.gmtime(time.mktime(datetime.fromtimestamp(timestamp).timetuple()))
else:
default_date_param = None