Alarmclock, input_datetime not showing 24h?

Hi guys,

I know the 24h vs am/pm discussion has been around for a while, and I’ve tried to search the forum as well as google around for a solution. I’m working on an alarm clock and what I find very strange is that the sensor.time is showing what I expect, while the input_datetime doesn’t. Why are they different?

Example:
image

On the above UI, I’m using picture-elements where (as far as I can see) the sensor.time and input_datetime entries are configured equally with regards to time. An excerpt:

            #HEADER 
          - type: state-label
            entity: input_datetime.alarmclock_alarm_setpoint
            style:
              background-color: '#cccccc'
              border-color: 'rgb(34, 154, 210)'
              border-radius: 6px
              color: 'rgb(255, 255, 255)'
              font-family: Trebuchet MS
              font-size: 150%
              font-weight: bold
              text-align: center
              right: 38%
              left: 38%
              top: 14%
              transform: 'translate(0%,-50%)'
            tap_action:
                action: more-info

            #RIGHT COL
          - type: state-label
            entity: sensor.time
            prefix: "Current time "
            style:
              border-color: 'rgb(34, 154, 210)'
              border-right-style: solid
              color: '#3090C7'
              font-family: Trebuchet MS
              font-size: 76%
              font-weight: bold
              pointer-events: none
              right: 1%
              top: 35%
              transform: 'translate(0%,-50%)'

Anyone with a good explanation, or even better a fix for this? I’ve been trying to change language etc, but everything else is already 24h so I don’t understand why this card suddenly decides to show me am/pm.

Cheers.

Anyone? This whole clock thing is annoying.

Visit finity’s EPIC Thread on Time Manipulation
You will be able to convert one type of formatted time to other types.

Thanks for your reply, I’ll study it in more detail. Still don’t see any reason why the system would show me time in two different ways though, but perhaps it is possible to force it somehow.

they area different because they are being translated into the UI. Sensor.time doesn’t get translated because the sensor domain does not have a ‘time’ units. So the Frontend doesn’t know how to translate it. This leads to input datetimes being translated into your browsers(might be os, don’t remember), and your sensor.time just presenting the untranslated time.