I am having an issue and have been digging for awhile now. I have a couple sensors that are a date, but HA wants to display them differently then I would like. I would like them to always display the date and time instead of yesterday or last month. See below.
Home Assistant knows the last reboot, but I can’t seem to figure out how to create anything that will put this in a useable sensor or display it.
I suspect those sensors have their device_class set to timestamp. Home Assistant’s frontend automatically displays a timestamp sensor’s value as relative to the current time (i.e. Yesterday, Last month). To my knowledge there’s no override in the frontend for this automatic timestamp formatting (maybe in the future).
The workaround is to create a Template Sensor that simply reports the timestamp’s sensor’s state value (just be sure not to set the Template Sensor’s device_class to timestamp otherwise its value will also be displayed as relative time by the frontend).
I had similar annoyance where I wanted an actual sunset timestamp but HA kept giving it to me ‘In X hours’.
Simplest way I found was to create a template sensor under Helpers in ‘Devices & Services’. Pasted the following line in State template field and left 3 dropdown menus blank.