Timestamp and time calculations

I have a sensor that returns a date / time in this format ( it is an uptime sensor, ie) the date and time that a given system started ):

2025-02-09T18:20:08+00:00

I’m trying to calculate days, hours, minutes of uptime by using a calculation like this:

{{ (as_timestamp(now()) - as_timestamp(states(‘sensor.uptime’))) | timestamp_custom(“%d days, %H:%M:%S”) }}

The as_timestamp(states('sensor.uptime)) does not return the correct value, hence the calculation is bogus. What am I doing wrong?

What about this:

{{ now() - states('sensor.uptime')|as_datetime }}

Or maybe;

{{ now() - states('sensor.uptime')|as_datetime|as_local }}

Thank you, that is a step in the right direction, that returns:

20:21:52.471385

Which is accurate as HH:MM:SS:MMMM ( I think ). I want this formatted as:

X days, Y minutes, Z seconds

So, I did this:

{{ time_since(as_datetime(states(‘sensor.uptime’)),precision=3) }} which shows:

20 hours 21 minutes 52 seconds

Thanks for your help!!