Opened 19 years ago
Closed 18 years ago
#1977 closed defect (fixed)
[patch] Wrong URL for timezone advice in settings.py
Reported by: | Joeboy | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | *.djangoproject.com | Version: | 0.95 |
Severity: | minor | Keywords: | timezone datetime |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The boilerplate settings.py contains the following advice:
# Local time zone for this installation. All choices can be found here:
# http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
I looked at that list and naively set my timezone to 'Europe/London GB GB-Eire'. Consequently my (mysql) database lookups broke in a confusing way. Setting it to just 'Europe/London' instead fixed the problem.
Cheers.
Attachments (1)
Change History (10)
comment:1 by , 19 years ago
comment:2 by , 18 years ago
I dunno about that. If you read the text just before the table, you see "In many cases there are several equivalent names for the same zone. These are listed on the same line."
The confusing part is that they don't say the names are separated by spaces (I guess that's to be inferred by the use of slashes for linking names). I think the documentation says that each of those names are equivalent, however.
comment:3 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 18 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Summary: | Misleading timezone advice in settings.py → Wrong URL for timezone advice in settings.py |
The link given in settings.py no longer is correct, since PostGres 8.2 came out.
The CORRECT link is
http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
NOT
http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
(current -> 8.1)
comment:5 by , 18 years ago
Component: | django-admin.py → Django Web site |
---|---|
Severity: | normal → minor |
Version: | SVN → 0.95 |
comment:6 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:7 by , 18 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
The issue still exists in django/conf/project_template/settings.py... ;-)
by , 18 years ago
Attachment: | tz-settings.diff added |
---|
patch for timezone link in settings.py boilerplate
comment:8 by , 18 years ago
Summary: | Wrong URL for timezone advice in settings.py → [patch] Wrong URL for timezone advice in settings.py |
---|
Patch attached.
comment:9 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
To explain a bit more what the problem here is: if you set the timezone to 'Europe/London' then all the date/time functions respect DST settings. With a string like 'Europe/London GB GB-Eire', it is internally mapped to something like "UTC + 0 always" at some level (not sure whether it's in the Python library or the C library). So, today, the longer setting for TIME_ZONE will mean that datetime.datetime.now() inside Django will be wrong (due to daylight savings being in effect in London).
PostgreSQL is too flexible in what it accepts. C libraries, not so much.