#30638: Allow the per-database TIME_ZONE option on databases that support
timezones.
-------------------------------------+-------------------------------------
     Reporter:  Aymeric Augustin     |                    Owner:  Aymeric
                                     |  Augustin
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Aymeric Augustin):

 I submitted a PR that does three things:

 1. Remove the check that prevented setting the TIME_ZONE option on
 PostgreSQL
 2. Set the database connection's time zone to the value of the TIME_ZONE
 option
 3. Attach the correct time zone information to objects returned from the
 database

 This fixes #23524 and #30288 but not the problem I was having! ;-)

 Anyway, I think it's a worthwhile improvement. At least two people want
 for this feature.

 Time zone support has gotten a lot of use since I wrote it. I'm more
 confident and willing to make this change now than five years ago.

 ----

 My actual issue is that I'm getting naive datetimes from the database
 (because the fields are defined as `timestamp` rather than `timestamp with
 time zone`) and nothing makes them aware, so they're just displayed "as
 is" in the admin.

 The correct way to tackle this is to write a `NaiveDateTimeField` to make
 the appropriate conversions i.e. add time zone information to values read
 from the database. This doesn't require changes in Django.

 ----

 I'm proposing to close this as wontfix, to reopen #23524, and to change PR
 11582 to fix #23524 instead.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30638#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" 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-updates/067.e09da24fac9c2e45f05cf01e066fa2f0%40djangoproject.com.

Reply via email to