mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 09:17:06 +00:00
time section: tweaks (#12077)
Added empty string before notes and enclosed the example in {%raw%}{%endraw%}
This commit is contained in:
parent
fb08878719
commit
813f484b9c
@ -179,10 +179,14 @@ The same thing can also be expressed as a filter:
|
|||||||
- Filter `timestamp_local` converts an UNIX timestamp to its string representation as date/time in your local timezone.
|
- Filter `timestamp_local` converts an UNIX timestamp to its string representation as date/time in your local timezone.
|
||||||
- Filter `timestamp_utc` converts a UNIX timestamp to its string representation representation as date/time in UTC timezone.
|
- Filter `timestamp_utc` converts a UNIX timestamp to its string representation representation as date/time in UTC timezone.
|
||||||
- Filter `timestamp_custom(format_string, local_time=True)` converts an UNIX timestamp to its string representation based on a custom format, the use of a local timezone is default. Supports the standard [Python time formatting options](https://docs.python.org/3/library/time.html#time.strftime).
|
- Filter `timestamp_custom(format_string, local_time=True)` converts an UNIX timestamp to its string representation based on a custom format, the use of a local timezone is default. Supports the standard [Python time formatting options](https://docs.python.org/3/library/time.html#time.strftime).
|
||||||
|
|
||||||
Note: [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) is the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970. Therefore, if used as a function's argument, it can be substituted with a numeric value (`int` or `float`):
|
Note: [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) is the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970. Therefore, if used as a function's argument, it can be substituted with a numeric value (`int` or `float`):
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
```yaml
|
```yaml
|
||||||
{{ 120 | timestamp_local }}
|
{{ 120 | timestamp_local }}
|
||||||
```
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
### To/From JSON
|
### To/From JSON
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user