Sensor.worldclock standard time vs. military time

Any way we can display the time zones in 12hr vs 24hr? Will the yaml below work assuming “sensor.timezone” is the sensor setup using the worldclock component?

value_template: ‘{{ as_timestamp(sensor.timezone) | timestamp_custom("%I:%M %P") }}’