diff options
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/templates/builtins.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index 2b3d48d90e..146f2eacd6 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -799,6 +799,18 @@ This would display as "It is the 4th of September". It is {% now "SHORT_DATETIME_FORMAT" %} + +You can also use the syntax ``{% now "Y" as current_year %}`` to store the +output inside a variable. This is useful if you want to use ``{% now %}`` +inside a template tag like :ttag:`blocktrans` for example:: + + {% now "Y" as current_year %} + {% blocktrans %}Copyright {{ current_year }}{% endblocktrans %} + +.. versionadded:: 1.8 + +The ability to use the "as" syntax was added. + .. templatetag:: regroup regroup |
