summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorJoe Jackson <cpmhjoe@gmail.com>2020-08-29 14:40:54 -0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-09-02 07:42:27 +0200
commit9d5d865fd6e989abe60fdf02e7f97fd4d98178a4 (patch)
treea2026e2afe2c73c4e149de3cde0a3dbf050c2ae1 /docs/ref
parent76e0151ea0e0f56dca66cee846a78b89346d2c4c (diff)
Fixed #31948 -- Added tzinfo parameter to TruncDate() and TruncTime().
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/models/database-functions.txt12
1 files changed, 10 insertions, 2 deletions
diff --git a/docs/ref/models/database-functions.txt b/docs/ref/models/database-functions.txt
index f5efdb7e87..3121a36fa9 100644
--- a/docs/ref/models/database-functions.txt
+++ b/docs/ref/models/database-functions.txt
@@ -623,20 +623,28 @@ that deal with date-parts can be used with ``DateField``::
``DateTimeField`` truncation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. class:: TruncDate(expression, **extra)
+.. class:: TruncDate(expression, tzinfo=None, **extra)
.. attribute:: lookup_name = 'date'
.. attribute:: output_field = DateField()
+ .. versionchanged:: 3.2
+
+ The ``tzinfo`` parameter was added.
+
``TruncDate`` casts ``expression`` to a date rather than using the built-in SQL
truncate function. It's also registered as a transform on ``DateTimeField`` as
``__date``.
-.. class:: TruncTime(expression, **extra)
+.. class:: TruncTime(expression, tzinfo=None, **extra)
.. attribute:: lookup_name = 'time'
.. attribute:: output_field = TimeField()
+ .. versionchanged:: 3.2
+
+ The ``tzinfo`` parameter was added.
+
``TruncTime`` casts ``expression`` to a time rather than using the built-in SQL
truncate function. It's also registered as a transform on ``DateTimeField`` as
``__time``.