Why is this code spitting out a time 6 hour different then the time set in the entity?

I am using the following code to display the time set in an input_datetime entity, but the code below shows the time at 3:51PM. When the entity is actually 9:51PM.

image

image

{% set time = state_attr('input_datetime.garden_watering_stop_time', 'timestamp') %}
{{ time | timestamp_custom('%I:%M %p') }}

Hi @nappyjim,

Is are the two times based off the same exact time zone?
Is it possible one is you local time and the other UTC?

Thats what I am guessing but I dont know how to change the code I posted, the one thats showing 3:51; how I change that to show 9:51.

1 Like
{{ today_at(states('input_datetime.garden_watering_stop_time')).strftime('%I:%M %p') }}
2 Likes

@Didgeridrew

Thank you!