Opened 9 years ago

Closed 8 years ago

#1977 closed defect (fixed)

[patch] Wrong URL for timezone advice in settings.py

Reported by: Joeboy Owned by: adrian
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: UI/UX:

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@… 8 years ago.
patch for timezone link in settings.py boilerplate

Download all attachments as: .zip

Change History (10)

comment:1 Changed 9 years ago by mtredinnick

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 Changed 9 years ago by nirvdrum

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 Changed 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:4 Changed 8 years ago by anonymous

  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Summary changed from Misleading timezone advice in settings.py to Wrong URL for timezone advice in settings.py

comment:5 Changed 8 years ago by anonymous

  • Component changed from django-admin.py to Django Web site
  • Severity changed from normal to minor
  • Version changed from SVN to 0.95

comment:6 Changed 8 years ago by adrian

  • Resolution set to fixed
  • Status changed from reopened to closed

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

comment:7 Changed 8 years ago by regexbot@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

Changed 8 years ago by regexbot@…

patch for timezone link in settings.py boilerplate

comment:8 Changed 8 years ago by regexbot@…

  • Summary changed from Wrong URL for timezone advice in settings.py to [patch] Wrong URL for timezone advice in settings.py

Patch attached.

comment:9 Changed 8 years ago by adrian

  • Resolution set to fixed
  • Status changed from reopened to closed

(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