Django’s DateTimeField parsing code is really targeted at values typed by 
humans. It doesn’t handle time zones because humans don’t tend to write them 
down :)

Wouldn’t it be easier to write an ISODateTimeField? It could take advantage of 
django.utils.dateparse.parse_datetime, which parses an ISO datetime reasonably 
fast and handles time zone offsets.

-- 
Aymeric.



On 8 janv. 2014, at 01:53, Andres Osinski <andres.osin...@gmail.com> wrote:

> Hi everyone, I wanted to bring up a request: Ticket #11385 dealt with 
> Django's DateTimeField being unable to handle ISO 8601 date formats.
> 
> At the time it seemed reasonable to not support this feature given, however, 
> given the proliferation of web service APIs that return dates using this 
> format, it is natural to use forms to validate the outputs of such services, 
> and having it not baked in while depending on strftime's formatting behavior 
> (which seems to fail tremendously for such datetime formats) makes working 
> with such data very awkward.
> 
> I can volunteer to do the bulk of the effort if there's any chance to have a 
> more experienced member of the community go over my work to make sure a 
> decent patch can be submitted.
> 
> Cheers
> 
> -- 
> Andrés Osinski
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/CA%2BxF-PzQ1Vg4aTReu0ZW%3DdOAc2HCzysaLN73%3Dk%3D9-2%2BQwWv8Ow%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/97F059CD-54D8-4B5F-A047-CE0AB3AF03DE%40polytechnique.org.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to