diff --git a/source/_docs/configuration/templating.markdown b/source/_docs/configuration/templating.markdown index 131d083e9a6..33f07722ad2 100644 --- a/source/_docs/configuration/templating.markdown +++ b/source/_docs/configuration/templating.markdown @@ -587,7 +587,7 @@ For example, if you wanted to select a field from `trigger` in an automation bas {% endraw %} -- `as_datetime()` converts a string containing a timestamp, or valid UNIX timestamp, to a datetime object. +- `as_datetime(value, default)` converts a string containing a timestamp, or valid UNIX timestamp, to a datetime object. If that fails, returns the `default` value, or if omitted raises an error. This function can also be used as a filter. - `as_timestamp(value, default)` converts datetime object or string to UNIX timestamp. If that fails, returns the `default` value, or if omitted raises an error. This function can also be used as a filter. - `as_local()` converts datetime object to local time. This function can also be used as a filter. - `strptime(string, format, default)` parses a string based on a [format](https://docs.python.org/3.10/library/datetime.html#strftime-and-strptime-behavior) and returns a datetime object. If that fails, it returns the `default` value or, if omitted, raises an error.