mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #24866 -- Added Now() database function
This commit is contained in:
parent
002b3d87b5
commit
23048d186c
4 changed files with 75 additions and 2 deletions
|
@ -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
|
||||
------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue