Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Added notes to docs regarding new requirement for time zone definitions #1620

Closed
wants to merge 2 commits into from

3 participants

Matt Austin Tim Graham Simon Charette
Matt Austin

Time zone definitions required in database for day, month, and week_day lookups.

https://code.djangoproject.com/ticket/21095

docs/releases/1.6.txt
@@ -435,6 +435,17 @@ but will not be removed from Django until version 1.8.
435 435
436 436 .. _recommendations in the Python documentation: http://docs.python.org/2/library/doctest.html#unittest-api
437 437
  438 +
1
Tim Graham Owner

only 1 space between sections (above a below this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
docs/releases/1.6.txt
@@ -435,6 +435,17 @@ but will not be removed from Django until version 1.8.
435 435
436 436 .. _recommendations in the Python documentation: http://docs.python.org/2/library/doctest.html#unittest-api
437 437
  438 +
  439 +Time zone support for ``day``, ``month``, and ``week_day`` lookups
  440 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  441 +
  442 +Django 1.6 introduces time zone support for ``day``, ``month``, and ``week_day``
  443 +lookups, which were previously performed in UTC rather than the active timezone.
4
Tim Graham Owner

by "active timezone" I assume you mean :setting:`TIME_ZONE`?

Simon Charette Owner

Not necessarily. It defaults to :setting:TIME_ZONE but one can set it manually using django.utils.timezone.activate (which is thread local) the same way django.utils.translation.activate works.

Maybe we should refer to it as 'current timezone'? The time zone which has been activated in the thread, (or settings.TIME_ZONE as a default) is returned by the django.utils.timezone.get_current_timezone() method.

Tim Graham Owner

Yea, I guess "current" would be be consistent with https://docs.djangoproject.com/en/dev/topics/i18n/timezones/#selecting-the-current-time-zone

Although I'm sure someone who uses timezone support more than I do would understand either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Matt Austin

Thanks for the feedback, I've made a small update to refer to 'current time zone', and remove the superfluous blank lines. If accepted, these doc updates will also need to be cherry-picked to stable-1.6.x and stable-1.7.x branches.

Tim Graham
Owner

merged in 9451d8d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.

Showing 2 changed files with 16 additions and 3 deletions. Show diff stats Hide diff stats

  1. +6 3 docs/ref/models/querysets.txt
  2. +10 0 docs/releases/1.6.txt
9 docs/ref/models/querysets.txt
@@ -2274,7 +2274,8 @@ SQL equivalent::
2274 2274 (The exact SQL syntax varies for each database engine.)
2275 2275
2276 2276 When :setting:`USE_TZ` is ``True``, datetime fields are converted to the
2277   -current time zone before filtering.
  2277 +current time zone before filtering. This requires
  2278 +:ref:`time zone definitions in the database <database-time-zone-definitions>`.
2278 2279
2279 2280 .. fieldlookup:: day
2280 2281
@@ -2297,7 +2298,8 @@ Note this will match any record with a pub_date on the third day of the month,
2297 2298 such as January 3, July 3, etc.
2298 2299
2299 2300 When :setting:`USE_TZ` is ``True``, datetime fields are converted to the
2300   -current time zone before filtering.
  2301 +current time zone before filtering. This requires
  2302 +:ref:`time zone definitions in the database <database-time-zone-definitions>`.
2301 2303
2302 2304 .. fieldlookup:: week_day
2303 2305
@@ -2321,7 +2323,8 @@ Note this will match any record with a ``pub_date`` that falls on a Monday (day
2321 2323 are indexed with day 1 being Sunday and day 7 being Saturday.
2322 2324
2323 2325 When :setting:`USE_TZ` is ``True``, datetime fields are converted to the
2324   -current time zone before filtering.
  2326 +current time zone before filtering. This requires
  2327 +:ref:`time zone definitions in the database <database-time-zone-definitions>`.
2325 2328
2326 2329 .. fieldlookup:: hour
2327 2330
10 docs/releases/1.6.txt
@@ -435,6 +435,16 @@ but will not be removed from Django until version 1.8.
435 435
436 436 .. _recommendations in the Python documentation: http://docs.python.org/2/library/doctest.html#unittest-api
437 437
  438 +Time zone support for ``day``, ``month``, and ``week_day`` lookups
  439 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  440 +
  441 +Django 1.6 introduces time zone support for ``day``, ``month``, and ``week_day``
  442 +lookups, which were previously performed in UTC rather than the current time
  443 +zone.
  444 +
  445 +This requires time zone definitions in the database when :setting:`USE_TZ` is
  446 +``True``. :ref:`Learn more <database-time-zone-definitions>`.
  447 +
438 448 Addition of ``QuerySet.datetimes()``
439 449 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
440 450

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.