Option to disable Zulu (Z) formatted date time representations #8169
Unanswered
aleehedl
asked this question in
Ideas & Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Django Rest Framework's DateTimeField component substitutes
+00:00
withZ
into_representation
method. While it's certainly valid ISO 8601, I find that format inconvenient since there is no built-in way in python to produce that. I usually encounter this while creating tests, and usually resort to rolling my own isoformat function.The code responsible for the substitution can be found here:
django-rest-framework/rest_framework/fields.py
Line 1240 in fdb4931
Do you think it would be worth it to have a setting which would bypass this substition?
Or should I always subclass the DateTimeField (with it's
to_representation
to my liking) and use it everywhere? Custom format string for the DateTimeField cannot be used to produce the+00:00
either.Beta Was this translation helpful? Give feedback.
All reactions