Datetime objects in JSON are integers, not strings.
This commit is contained in:
parent
343eb506d7
commit
0615b830bb
@ -80,7 +80,7 @@ def default(obj):
|
||||
# TODO share this code w/ bson.py?
|
||||
millis = int(calendar.timegm(obj.timetuple()) * 1000 +
|
||||
obj.microsecond / 1000)
|
||||
return {"$date": str(millis)}
|
||||
return {"$date": millis}
|
||||
if isinstance(obj, _RE_TYPE):
|
||||
flags = ""
|
||||
if obj.flags & re.IGNORECASE:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user