[enh] Use isoformat date RFC 3339

This commit is contained in:
ljf (zamentur) 2018-06-09 11:38:43 +02:00 committed by GitHub
parent 4e4fb4125b
commit cf07c34fe3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,7 +27,7 @@ class JSONExtendedEncoder(JSONEncoder):
# Convert compatible containers into list # Convert compatible containers into list
if isinstance(o, datetime.datetime) or isinstance(o, datetime.date): if isinstance(o, datetime.datetime) or isinstance(o, datetime.date):
return str(o) return o.isoformat()
# Return the repr for object that json can't encode # Return the repr for object that json can't encode
logger.warning('cannot properly encode in JSON the object %s, ' logger.warning('cannot properly encode in JSON the object %s, '