Documentation for timestamp_custom (#911)

This commit is contained in:
Lewis Juggins 2016-09-10 13:13:48 +01:00 committed by Fabian Affolter
parent ced030c881
commit 91478d8dab

View File

@ -80,6 +80,7 @@ Home Assistant adds extensions to allow templates to access all of the current s
- Filter `round(x)` will convert the input to a number and round it to `x` decimals.
- Filter `timestamp_local` will convert an UNIX timestamp to local time/data.
- Filter `timestamp_utc` will convert an UNIX timestamp to UTC time/data.
- Filter `timestamp_custom(format_string, local_boolean)` will convert an UNIX timestamp to a custom format, the use of a local timestamp is default, supporting [Python format options](https://docs.python.org/3/library/time.html#time.strftime).
## {% linkable_title Examples %}
@ -199,4 +200,5 @@ It depends per component or platform but it is common to be able to define a tem
# Timestamps
{% raw %}{{ value_json.tst | timestamp_local }}{% endraw %}
{% raw %}{{ value_json.tst | timestamp_utc }}{% endraw %}
{% raw %}{{ value_json.tst | timestamp_custom('%Y' True) }}{% endraw %}
```