The missing 5% is the th in 4th. That thing changes depending on the number (1st, 2nd, 3rd, 4th, 5th). Including it in the template is … more work than I’m willing to invest.
Be advised that you requested to convert 2019-04-01 17:30:00 to April 4th 2019 4:30pm. I assume you meant 5:30pm (the equivalent of 17:30). However if you really want the conversion to subtract one hour then this will do it:
First, Thanks for your help. Truly appreciate it!
Im sorry, I posted the wrong sensor, that’s why the time is off.
it should have been sensor.meet_start.
I do use this to the the sufixes on my normal dates, so im sure ill figure something out for that.
{%- macro ordinal(num) %}
{%- set d = {1:‘st’,2:‘nd’,3:‘rd’} %}
{%- set num = num | int %}
{%- if 10 < num % 100 <= 20 %}
{{- num }}th
{%- else %}
{{- num }}{{ d.get(num % 10, ‘th’) }}
{%- endif %}
{%- endmacro %}
{{ ordinal(states(‘sensor.day_us’)) }}
EDIT: this did work, {{as_timestamp(states('sensor.meet_start')) | timestamp_custom('%B %-d %Y %-I:%M%p', 'true') }}
Now onto the next task with the rd,th,st part thanks again, I owe you one!