Are you talking about incoming data? If so you should be sending ISO aware
date-time objects as such: 2019-05-12T16:27:34.503919-04:00
If you are talking about outgoing data then you should be saving in the DB
aware UTC date-times as python datetime objects.
DRF will always do the right thing if you always do the above.

Aware means with the time zone.
Naive means without the time zone.

Always always always save UTC time, but not all databases let you store the
time zone.

On Thu, Aug 15, 2019 at 12:35 PM Baze Blackwood <
[email protected]> wrote:

> It seems that DRF's default behavior is to stringify the object returned
> by DateRangeField. For example, this is how an entry appears in a "dates"
> field which uses this field.
>
> "dates": "{\"bounds\": \"[)\", \"lower\": \"2019-07-19\", \"upper\":
> \"2019-09-14\"}",
> Has anyone else experienced this behavior and/or know how to get it to
> preserve the object?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-rest-framework/7947ec40-6540-455b-b2d5-85ed176fa7dc%40googlegroups.com
> <https://groups.google.com/d/msgid/django-rest-framework/7947ec40-6540-455b-b2d5-85ed176fa7dc%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
-------------------------------------------------------------------------------
Carl J. Nobile (Software Engineer)
[email protected]
-------------------------------------------------------------------------------

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/CAGQqDQJYFuNe3M0Ms_aT1epooMiN78foXTQcXv1wTEH%2BG3pHkQ%40mail.gmail.com.

Reply via email to