mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 05:46:52 +00:00
Add missing "can" in templating docs (#21196)
This commit is contained in:
parent
d48e2db966
commit
59cbb73907
@ -319,8 +319,8 @@ The same thing can also be expressed as a filter:
|
||||
{% endraw %}
|
||||
|
||||
- `as_datetime()` converts a string containing a timestamp, or valid UNIX timestamp, to a datetime object.
|
||||
- `as_timestamp(value, default)` converts datetime object or string to UNIX timestamp. If that fails, returns the `default` value, or if omitted `None`. This function also be used as a filter.
|
||||
- `as_local()` converts datetime object to local time. This function 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 `None`. 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)` parses a string based on a [format](https://docs.python.org/3.8/library/datetime.html#strftime-and-strptime-behavior) and returns a datetime object. If that fails, returns the `default` value, or if omitted the unprocessed input value.
|
||||
- `relative_time` converts datetime object to its human-friendly "age" string. The age can be in second, minute, hour, day, month or year (but only the biggest unit is considered, e.g., if it's 2 days and 3 hours, "2 days" will be returned). Note that it only works for dates _in the past_.
|
||||
- `timedelta` returns a timedelta object and accepts the same arguments as the Python `datetime.timedelta` function -- days, seconds, microseconds, milliseconds, minutes, hours, weeks.
|
||||
|
Loading…
x
Reference in New Issue
Block a user