Custom Time and Date format

I’m trying to create a template to format the date of last backup as a custom, I can get it to display correctly as an entity, but when I try to template it I can not get it to work. I understand that in a entity, I can select an attribute of Last backup and it will display. I am not sure how to do this in a template.

Here is what I have so far:

  - platform: template
    sensors:
      last_backup_formatted:
        friendly_name: "Last Backup Date"
        value_template: >
          {{ states(''sensor.backup_state') | as_timestamp | timestamp_custom('%A, %B %d, %Y %I:%M %p') }}

Any ideas?
TIA

Thank you very much. I adapted your code for germany (taken from a markdown lovelace card)

# <center> {{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%H:%M') }}
{% set days = ['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag'] %}
{% set months = ['Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','December'] %}
## <center> {{ days[now().weekday()] }}{{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom(', %-d. ') }}{{ months[now().month-1] }}{{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom(' %Y') }}
1 Like