From 549210b50f2c4abbae0bdd56c5c7a02091b6cae3 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 11 Jul 2016 14:34:23 +0100 Subject: [PATCH] Don't strip microseconds in JSON output. (#4256) --- rest_framework/utils/encoders.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/rest_framework/utils/encoders.py b/rest_framework/utils/encoders.py index e5b52ea5f..8203a7bc8 100644 --- a/rest_framework/utils/encoders.py +++ b/rest_framework/utils/encoders.py @@ -28,8 +28,6 @@ class JSONEncoder(json.JSONEncoder): return force_text(obj) elif isinstance(obj, datetime.datetime): representation = obj.isoformat() - if obj.microsecond: - representation = representation[:23] + representation[26:] if representation.endswith('+00:00'): representation = representation[:-6] + 'Z' return representation