From 61f0d6b91972a4b8759dc0fef3782cec90f46956 Mon Sep 17 00:00:00 2001 From: Sascha Marcel Schmidt Date: Fri, 8 Jan 2021 16:47:23 +0100 Subject: [PATCH] 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> --- docs/docsite/rst/user_guide/playbooks_filters.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/docsite/rst/user_guide/playbooks_filters.rst b/docs/docsite/rst/user_guide/playbooks_filters.rst index 66c3fa8ba73..457df1de995 100644 --- a/docs/docsite/rst/user_guide/playbooks_filters.rst +++ b/docs/docsite/rst/user_guide/playbooks_filters.rst @@ -1660,6 +1660,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