Convert seconds to compound duration: Difference between revisions
Content added Content deleted
m (→{{header|Perl}}: use 'printf' instead of 'print sprintf') |
m (tiny clarification) |
||
Line 1: | Line 1: | ||
{{draft task}} |
{{draft task}} |
||
Write a function or program which |
Write a function or program which |
||
* takes |
* takes a positive integer representing a duration in seconds as input (e.g. <code>100</code>), and |
||
* returns a string which shows the same duration decomposed into weeks, days, hours, minutes, and seconds as detailed below (e.g. "<code>1 min, 40 sec</code>"). |
* returns a string which shows the same duration decomposed into weeks, days, hours, minutes, and seconds as detailed below (e.g. "<code>1 min, 40 sec</code>"). |
||
Line 26: | Line 26: | ||
<ul> |
<ul> |
||
<li>The following five units should be |
<li>The following five units should be used: |
||
{| class="wikitable" |
{| class="wikitable" |
||
|- |
|- |