Help needed with time templating

I think you want strptime. That creates a datetime from a string.

{% set time = "12:45" %}
{{ strptime(time, "%H%M") }}

Using the template dev tool is a great way to experiment and test.

Do a forum search for strptime and you’ll see some examples. But I ran into issues getting it to work, so did some splitting of strings…

1 Like