From 7003174fec188bd5a21e3d62bd5e13e80f6f329c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 14 Jun 2016 12:57:17 +0300 Subject: [PATCH] Fixed #26754 -- Documented django.template.context_processors.tz --- docs/ref/templates/api.txt | 8 ++++++++ docs/topics/i18n/timezones.txt | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt index 94492702ca..2054a5e4d8 100644 --- a/docs/ref/templates/api.txt +++ b/docs/ref/templates/api.txt @@ -736,6 +736,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`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/topics/i18n/timezones.txt b/docs/topics/i18n/timezones.txt index 7beffdea72..e9abc22f59 100644 --- a/docs/topics/i18n/timezones.txt +++ b/docs/topics/i18n/timezones.txt @@ -315,9 +315,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 ----------------