Convert seconds to compound duration: Difference between revisions

Content added Content deleted
No edit summary
(K)
Line 2,441: Line 2,441:
duration(6000000) = "9w, 6d, 10h, 40m"
duration(6000000) = "9w, 6d, 10h, 40m"
</pre>
</pre>

=={{header|K}}==
<syntaxhighlight lang=K>F:{", "/" "/'+($x[s]),s:,&0<x}(" "\"wk d hr min sec")!0 7 24 60 60\</syntaxhighlight>

Examples:

<syntaxhighlight lang=K>F 100
"1 min, 40 sec"
F 7259
"2 hr, 59 sec"
F 86400
"1 d"
F 6000000
"9 wk, 6 d, 10 hr, 40 min"</syntaxhighlight>

tested in ngn/k


=={{header|Kotlin}}==
=={{header|Kotlin}}==