mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-13 18:50:29 +03:00
make sure all timestamps in index-v1 are utc
This commit is contained in:
parent
290b9050e0
commit
26192a00e2
2 changed files with 28 additions and 25 deletions
|
|
@ -30,6 +30,7 @@ import shutil
|
|||
import tempfile
|
||||
import urllib.parse
|
||||
import zipfile
|
||||
import calendar
|
||||
from binascii import hexlify, unhexlify
|
||||
from datetime import datetime
|
||||
from xml.dom.minidom import Document
|
||||
|
|
@ -165,7 +166,9 @@ def make_v1(apps, packages, repodir, repodict, requestsdict, fdroid_signing_key_
|
|||
if isinstance(obj, set):
|
||||
return sorted(list(obj))
|
||||
if isinstance(obj, datetime):
|
||||
return int(obj.timestamp() * 1000) # Java expects milliseconds
|
||||
# Java prefers milliseconds
|
||||
# we also need to accound for time zone/daylight saving time
|
||||
return int(calendar.timegm(obj.timetuple()) * 1000)
|
||||
raise TypeError(repr(obj) + " is not JSON serializable")
|
||||
|
||||
output = collections.OrderedDict()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue