-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't strip microseconds in JSON output. #4256
Conversation
Current coverage is 91.23%@@ master #4256 diff @@
==========================================
Files 52 52
Lines 5778 5776 -2
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 5270 5270
+ Misses 508 506 -2
Partials 0 0
|
There was a relevant comment in the original patch about why the microseconds are being truncated. It appears to have been lost throughout the years.
Which appears to have been copied out of the Django JSON serializer. In ECMA 262, the datetime string format is defined as |
The JSON spec has no guidance on datetime formatting. https://tools.ietf.org/html/rfc7159 The current default is for DateTimeField to coerce to strings, so This change ensures that we're consistent throughout. Users can still set |
But yes, very much wasn't sure on that when you re-raised. And there is the reading should be that JSON should be a subset of ECMA, but that seems pretty loose, stated as a design goal rather than a requirement. (and it's also not quite a subset) |
Refs: #4256 delete not relevant documentation
Closes encode#4749. This is the matching commit to the fix for `datetime` in encode#4256
Closes #4255.