The software doesn’t know anything like this per se. It’s just default behaviour to represent something – of which there can be many ways, and it depends on many factors (datetime values in general depend on your locale).
Ask the maintainer if they’re willing to match HA’s default behaviour.
I know this works but I cannot use it for my custom:multiple-entity-row card where I need to give an entity. I cannot manipulate it. How to fix it then?
Sounds like a complete overload. I already have a template sensor like the thread starter. It is insane that this is necessary for such an easy task. I have 10 of these entities with this requirement. It’s a complete bloat.
Perhaps, but you asked for help which I gave. I don’t know of another way. You can look for a custom card or something that might allow you to do this.