Template for to-do

Thanks to this topic, I found out how to create a list of titled to-do with their creation date.
In my template, I put this

# {{#custom_datetime}} YYYY-MM-DD{/custom_datetime}}
## To-do of the day

When I create a new to-do, I immediately apply the above template, otherwise it doesn’t work.