Timestamp handling mystery

Using Template in Developer tools I did this

CleanStart:{{ as_timestamp(state_attr('vacuum.xiaomi_vacuum_cleaner','clean_start')) | timestamp_custom('%a %d %b at %H:%M') }}
CleanStop:{{ as_timestamp(state_attr('vacuum.xiaomi_vacuum_cleaner','clean_stop')) | timestamp_custom('%a %d %b at %H:%M') }}
CleanTime:{{ (as_timestamp(state_attr('vacuum.xiaomi_vacuum_cleaner','clean_stop')) - as_timestamp(state_attr('vacuum.xiaomi_vacuum_cleaner','clean_start'))) | timestamp_custom('%H:%M') }}

Results in:
CleanStart:Fri 01 Jan at 15:56
CleanStop:Fri 01 Jan at 16:46

What is going on with the timestamp subtraction?
I am 10hrs ahead of UTC in Sydney, Australia but I just don’t get it.

I don’t know, but try this at the end…

timestamp_custom('%H:%M', false)

If it works I can offer an educated guess as to why, but you’d want confirmation from someone that actually understands the timestamp functions (which is definitely not me, may as well be in Martian)

That works, aah. I see. the vacuum returned UTC time which my locality caused 10hrs to be added to display. So it added 10hrs to my final elapsed time, weird but …

1 Like

That would be my educated guess.