0001-json-always-use-UTC-datetime-format-6927.patch
wcs/qommon/misc.py | ||
---|---|---|
388 | 388 |
class JSONEncoder(json.JSONEncoder): |
389 | 389 |
def default(self, obj): |
390 | 390 |
if isinstance(obj, time.struct_time): |
391 |
return qommon.strftime.strftime('%Y-%m-%dT%H:%M:%S', obj)
|
|
391 |
return datetime.datetime.utcfromtimestamp(time.mktime(obj)).isoformat() + 'Z'
|
|
392 | 392 |
# Let the base class default method raise the TypeError |
393 | 393 |
return json.JSONEncoder.default(self, obj) |
394 |
- |