time format standardization

12 views
Skip to first unread message

Alexandru Damian

unread,
Jun 14, 2016, 11:01:59 AM6/14/16
to Django REST framework
Hi,

What should the JSON serialization format for DateTime objects ? I am a bit confused,
since the DateTimeField representation uses ISO-8601, and the JSONEncoder uses ECMA-262,
which is slightly different (microseconds are truncated to milliseconds).

I would have expected that the DateTimeField representation would pass down a `datetime` object,
to be encoded by an encoder, and the JSONEncoder would use ECMA-262, not just passing through
a ISO string representation. This is anyhow the documented behaviour 

Is this a bug or I am missing something ?

Cheers,
Alex
Reply all
Reply to author
Forward
0 new messages