Formatting Google Calendar in a template

I’m using TTS to output my next calendar event, however I want to reformat the event start time into something more readable in human language.

{{ state_attr('calendar.neil', 'message') }} on {{ state_attr('calendar.neil', 'start_time') }}

Gives me `Event on 2024-11-08 12:00:00’

Can someone assist me to reformat the date part of the template into something simple like ‘November 8’.

{{ state_attr('calendar.neil', 'message') }} on {{ (state_attr('calendar.neil', 'start_time') | as_datetime | as_local).strftime('%B %-d')

Here’s a cheat sheet for the different format codes that can be used with the strftime() function, in case you want something a little different.

1 Like

Amazing, exactly what I was after, it worked a treat. Thank you.