The scripting function $fmtDate(hh:mm:ss,x) used with an integer number for the second parameter x, to give the number of seconds to be converted in the format hour:minutes:seconds, always shows one hour more than it should. So e.g. zero seconds are one hour long, 3600 seconds are two hours and so on. The result seems to be correct in other cases, e.g. if used with no second parameter for the clock on the wall. This issue perhaps could be caused by the fact, that we currently still have west european summer time here, which is one hour plus.
It takes a raw timestamp as second parameter, not the number of seconds.
The scripting function
$fmtDate(fmt,x)formats the raw timestampx(e.g.,%_file_mod_datetime_raw%) as a human-readable date using the format string fmt. Ifxis omitted, the current timestamp is used.
So sad that it isn't so easy as I first thought, to convert a duration in number of seconds into a human readable format with hours, minutes and seconds. But with the following expression I get the desired result (in a web source script)
json_select "duration"
sayformat "$num($div(%_current%,3600),2):$num($div($mod(%_current%,3600),60),2):$num($div($mod(%_current%,60)),2)"
You can use $fmtDuration(%_current%,s,1)
Thank you for pointing me to the best solution. I see I shouldn't have stopped reading the documentation at $fmtDate but continue reading the rest of it also.
