From bf29290ba039655d1e993fc52fbbf7607fb4f24e Mon Sep 17 00:00:00 2001 From: Jakob Schlyter Date: Sat, 12 Sep 2020 07:31:59 +0200 Subject: [PATCH] add timedelta_seconds() (#14384) --- source/_docs/configuration/templating.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/source/_docs/configuration/templating.markdown b/source/_docs/configuration/templating.markdown index cac2260d0cc..dce917e3bc7 100644 --- a/source/_docs/configuration/templating.markdown +++ b/source/_docs/configuration/templating.markdown @@ -182,6 +182,7 @@ The same thing can also be expressed as a filter: - `as_local()` converts datetime object to local time. This function 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. - `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. - 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).