Skip to content

Commit 2085bd6

Browse files
rbdixonfabaff
authored andcommitted
Doc: Add as_timestamp as a Jinja filter. (home-assistant#8905)
1 parent c5c0cf9 commit 2085bd6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

source/_docs/configuration/templating.markdown

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ With strings:
149149
- For specific values: `now().second`, `now().minute`, `now().hour`, `now().day`, `now().month`, `now().year`, `now().weekday()` and `now().isoweekday()`
150150
- `utcnow()` will be rendered as UTC time.
151151
- For specific values: `utcnow().second`, `utcnow().minute`, `utcnow().hour`, `utcnow().day`, `utcnow().month`, `utcnow().year`, `utcnow().weekday()` and `utcnow().isoweekday()`.
152-
- `as_timestamp()` will convert datetime object or string to UNIX timestamp.
152+
- `as_timestamp()` will convert datetime object or string to UNIX timestamp. This function also be used as a filter.
153153
- `strptime(string, format)` will parse a string to a datetime based on a [format](https://docs.python.org/3.6/library/datetime.html#strftime-and-strptime-behavior).
154154
- Filter `timestamp_local` will convert an UNIX timestamp to local time/data.
155155
- Filter `timestamp_utc` will convert a UNIX timestamp to UTC time/data.
@@ -236,10 +236,10 @@ The other part of templating is processing incoming data. It allows you to modif
236236

237237
It depends per component or platform, but it is common to be able to define a template using the `value_template` configuration key. When a new value arrives, your template will be rendered while having access to the following values on top of the usual Home Assistant extensions:
238238

239-
| Variable | Description |
240-
| ------------ | -------------------------------------- |
241-
| `value` | The incoming value. |
242-
| `value_json` | The incoming value parsed as JSON. |
239+
| Variable | Description |
240+
|--------------|------------------------------------|
241+
| `value` | The incoming value. |
242+
| `value_json` | The incoming value parsed as JSON. |
243243

244244
This means that if the incoming values looks like the sample below:
245245

0 commit comments

Comments
 (0)