time section: tweaks (#12077)

Added empty string before notes and enclosed the example in {%raw%}{%endraw%}
This commit is contained in:
akasma74 2020-02-14 07:22:06 +00:00 committed by GitHub
parent fb08878719
commit 813f484b9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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_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).
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
{{ 120 | timestamp_local }}
```
{% endraw %}
### To/From JSON