Wrong time in now().timestamp() but correct in now().hour / now().minute

Hi guys,

can someone please tell me why there is a 1 hour delay in the following template (it is 17:50 now, so the timestamp thing is wrong):

{{ now().hour }}:{{ now().minute }} {## Gives 17:50 ##}
{{ now().timestamp() | timestamp_custom('%H:%M', false) }} {## Gives 16:50 ##}

I need the second one because the first one doesn’t give a preceding zero, so it gives e. g. 17:3 instead of 17:03. This leads to problems with the TTS system (Rhasspy) which doesn’t recognise this text as time. But if there’s a simpler solution, I’m open for everything! :slight_smile:

Thank you!

Change the false to true, in timestamp_custom, and it will report your local, timezone-adjusted time.

Reference: Templating - Time

The default value for the local option is true so both of these produce the same result:

timestamp_custom('%H:%M', true)
timestamp_custom('%H:%M')
1 Like

This worked, thanks!

1 Like