Not being able to use .format

Hey guys, so I’m trying to format this variable:

“–downtime” = {{ DateTime(macro("$last_state_change$")) - DateTime(macro("$last_state_down$")) }}

The variable prints downtime in seconds and I’d like to .format it to Hours, Minutes and seconds.

I did try many ways but I’m not being able to achieve that

Do you guys have any idea?

Thanks

Hi, maybe it helps for ideas with wich (script/programming) language you wan’t to do this. Icinga DSL, Perl, Python, Bash etc.
Maybe the Code snipset of the script or command (if it’s the DSL) would be advantageous.

Which ways did you try already?