Skip to content

Commit

Permalink
[1.9.x] Fixed #26754 -- Documented django.template.context_processors.tz
Browse files Browse the repository at this point in the history
Backport of 7003174 from master
  • Loading branch information
scop authored and bmispelon committed Jun 14, 2016
1 parent 324eaf4 commit b789d81
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions docs/ref/templates/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,14 @@ tag for protection against :doc:`Cross Site Request Forgeries
If this processor is enabled, every ``RequestContext`` will contain a variable
``request``, which is the current :class:`~django.http.HttpRequest`.

``django.template.context_processors.tz``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. function:: tz

If this processor is enabled, every ``RequestContext`` will contain a variable
``TIME_ZONE``, providing the name of the currently active time zone.

``django.contrib.messages.context_processors.messages``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
6 changes: 3 additions & 3 deletions docs/topics/i18n/timezones.txt
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ You can get the name of the current time zone using the

{% get_current_timezone as TIME_ZONE %}

If you enable the ``django.template.context_processors.tz`` context processor,
each :class:`~django.template.RequestContext` will contain a ``TIME_ZONE``
variable with the value of ``get_current_timezone()``.
Alternatively, you can activate the
:func:`~django.template.context_processors.tz` context processor and
use the ``TIME_ZONE`` context variable.

Template filters
----------------
Expand Down

0 comments on commit b789d81

Please sign in to comment.