WTH is date formatting so hard for an entity

I have a Fritzbox router, which has an uptime sensor which has the timestamp of the start of the connection (for example: 18 november 2024 - 18:50)

If I want to render this sensor in an entities list, I unwantedly get the 18 november - 18:50 rendered as ‘2 weeks ago’. I seem to have no control over how the output of the sensor would be. I do have this control over other sensors, in terms of their output resolution (for example, I can control a Kwh to be displayed in several ways, with the precision setting.

I would like to have a display option for time and dates as well. Now I can only solve the display of this sensor with a certain template sensor, which floods up my database.

I would like to have an option to show dates/times as:

  • Their actual time and date (maybe with precision options, day, month, hours, minutes, etc.)
  • Their “X weeks/days/hours ago” option (also with certain precision options). Now it’s only shown as X weeks ago, which isn’t very precise.
  • Their current sum towards Now(). For the uptime specifically I would like it to show as:

Uptime: 18 hours, 50 minutes, 30 seconds (also preferrably with certain precision options).

Don’t forget to vote for your own WTH

With an entities card you have format:

format string (optional)
How the state should be formatted. Currently only used for timestamp sensors. Valid values are: relative, total, date, time and datetime.

For other cards I have already open this WTH: WTH I’m not able to format timestamp sensors the same way in the frontend?

1 Like

That’s good to know! Doesn’t seem to be in the GUI, but it indeed works in yaml. Thanks!! Only thing I would wish to add to “total” then is to have more resolution, than just the ‘2 weeks’ I see now.