On Feb 20, 11:24 pm, Carl Meyer <c...@oddbird.net> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 02/20/2012 01:59 PM, Aymeric Augustin wrote: > > > The main reason for enabling time zone support by default in new > > projects (through the settings.py template) was to store UTC in the > > database (on SQLite, MySQL and Oracle; PostgreSQL always does that > > anyway). > > > This decision was certainly skewed by my background in enterprise > > software, where reliable handling of datetimes is a no brainer. But > > this isn't the most common use case for Django. > > > Python doesn't make it very easy to deal with time zones, so forcing > > that concept on developers isn't friendly. The "right way" to do > > things is impractical, and there isn't that much space for > > improvement. > > Can you give more specifics here? Exactly how much harder is it to work > with USE_TZ = True than USE_TZ = False for a new Django developer, > presuming they don't really care about timezones at this point and just > want to do things more or less right so as not to box themselves in a > corner if they want to add real timezone support in the future? > > I guess I think there's some value in setting people on the right path > earlier rather than later, but it really depends on exactly how much > harder that path is.
Some information about how hard this is can be gotten by updating the tutorial part I to correctly use timezone aware datetimes. The tutorial has actually the two most important problems in it: - How do I get a timezone aware datetime? This should be explained shortly in the tutorial, and link to further documentation. - How do I correctly compare dates in timezone aware setting? This should say that timezone affects what date it is. Here is how you compare correctly dates in timezone aware way. (The comparison should be localtime(self.pub_date).date() == localtime(now()).date()). I think a small warning about DateFields would be good here. Now, when you get how the timezone system in Django works it isn't really that hard to do. My point is mainly that the documentation currently doesn't actually work with USE_TZ = True, and there is some work in updating it. - Anssi -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.