Jump to content

Convert seconds to compound duration: Difference between revisions

K
No edit summary
(K)
Line 2,441:
duration(6000000) = "9w, 6d, 10h, 40m"
</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}}==
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.