add note regarding datetime docs (#72976)
Adds a note pointing to the datetime documentation as to_datetime does not use the time library but instead uses datetime. Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
This commit is contained in:
parent
d83200c530
commit
61f0d6b919
1 changed files with 2 additions and 0 deletions
|
@ -1661,6 +1661,8 @@ To get a date object from a string use the `to_datetime` filter::
|
|||
# get amount of days between two dates. This returns only number of days and discards remaining hours, minutes, and seconds
|
||||
{{ (("2016-08-14 20:00:12" | to_datetime) - ("2015-12-25" | to_datetime('%Y-%m-%d'))).days }}
|
||||
|
||||
.. note:: For a full list of format codes for working with python date format strings, see https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
To format a date using a string (like with the shell date command), use the "strftime" filter::
|
||||
|
|
Loading…
Reference in a new issue