Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106032

Customize Date and Time format

$
0
0

according to [Time & Date - Home Assistant], the customize date and time command should be as below

template:
  - sensor:
      - name: "Date and time test"
        state: "{{ as_timestamp(states('sensor.date_time')) | timestamp_custom('%d-%b-%Y, %I:%M:%S %p') }}"
        icon: "mdi:calendar-clock"

but somehow when I paste it to configuration.yaml. The date and time sensor show unavailable.

image

is that something wrong with my command?

The actual date & time format that I need is “DD-MMM-YYYY, h:mm:ss AM/PM”

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 106032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>