Opened 18 years ago

Closed 17 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)

tz-settings.diff (720 bytes ) - added by regexbot@… 17 years ago.
patch for timezone link in settings.py boilerplate

Download all attachments as: .zip

Change History (10)

comment:1 by Malcolm Tredinnick, 18 years ago

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.

comment:2 by nirvdrum, 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 Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

(In [3297]) Fixed #1977 -- Added clarification about TIME_ZONE setting.

comment:4 by anonymous, 17 years ago

Resolution: fixed
Status: closedreopened
Summary: Misleading timezone advice in settings.pyWrong URL for timezone advice in settings.py

comment:5 by anonymous, 17 years ago

Component: django-admin.pyDjango Web site
Severity: normalminor
Version: SVN0.95

comment:6 by Adrian Holovaty, 17 years ago

Resolution: fixed
Status: reopenedclosed

(In [4201]) Fixed #1977 -- Changed postgresql.org link regarding timezone choices in docs/settings.txt

comment:7 by regexbot@…, 17 years ago

Resolution: fixed
Status: closedreopened

The issue still exists in django/conf/project_template/settings.py... ;-)

by regexbot@…, 17 years ago

Attachment: tz-settings.diff added

patch for timezone link in settings.py boilerplate

comment:8 by regexbot@…, 17 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 Adrian Holovaty, 17 years ago

Resolution: fixed
Status: reopenedclosed

(In [4207]) Fixed #1977 -- Changed postgresql.org URL in global_settings.py and project_template/settings.py. Thanks, regexbot@…

Note: See TracTickets for help on using tickets.
Back to Top