Fixed #24866 -- Added Now() database function

This commit is contained in:
Adam Chainz 2015-05-29 15:54:10 +01:00 committed by Tim Graham
parent 002b3d87b5
commit 23048d186c
4 changed files with 75 additions and 2 deletions

View file

@ -117,6 +117,21 @@ Usage example::
>>> print(author.name_lower)
margaret smith
Now
---
.. class:: Now()
.. versionadded:: 1.9
Returns the database server's current date and time when the query is executed.
Usage example::
>>> from django.db.models.functions import Now
>>> Article.objects.filter(published__lte=Now())
[<Article: How to Django>]
Substr
------