We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 23bdae3 commit 32cb1d8Copy full SHA for 32cb1d8
1 file changed
v4.43/django/core/serializers/json.py
@@ -54,6 +54,8 @@ def default(self, o):
54
return o.strftime(self.TIME_FORMAT)
55
elif isinstance(o, decimal.Decimal):
56
return str(o)
57
+ elif isinstance(o, datetime.timedelta):
58
+ return o.days * 24*60*60 + o.seconds
59
else:
60
return super(DjangoJSONEncoder, self).default(o)
61
0 commit comments