mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
iso formated datetime aware fields with +0000 offset should use 'Z' suffix instead
This commit is contained in:
parent
09e4ee7ae3
commit
20fd738c85
|
@ -609,7 +609,10 @@ class DateTimeField(WritableField):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if self.format.lower() == ISO_8601:
|
if self.format.lower() == ISO_8601:
|
||||||
return value.isoformat()
|
ret = value.isoformat()
|
||||||
|
if ret.endswith('+00:00'):
|
||||||
|
ret = ret[:-6] + 'Z'
|
||||||
|
return ret
|
||||||
return value.strftime(self.format)
|
return value.strftime(self.format)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user