Help with date format in a template

I am using a input_datetime helper to just store a date to use in a template.
All I want to do is change the date format from yy/mm/dd to dd/month.

states(‘input_datetime.alfie’) shows 2024-04-21

Would like it to be states(‘input_datetime.alfie’) showing 21 Apr

Hello and welcome to the forum. Please format your config for the forum in future. See: https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

This should do what you want:

{{ state_attr('input_datetime.alfie','timestamp')|timestamp_custom('%m %b') }}

See this reference for other outputs: https://strftime.org/

1 Like

Perfect. Many thanks.

1 Like