Arbitrary Clock Time Calculator
Dyalog APL, 9 7 5 bytes
⌽⊤⍨∘⌽
This is a dyadic function train that expects seconds and lengths as left and right arguments. It is equivalent to the following, train-less function:
{⌽⍺⊤⍨⌽⍵}
Verify all test cases at once on TryAPL.
How it works
⌽ Reverse the right argument...
∘ and...
⊤⍨ perform mixed base encoding on the left argument with those bases.
⌽ Reverse the order of the result.
CJam, 10 bytes
{{md\}%W<}
Verify all test cases at once in the CJam interpreter.
How it works
{ } Define a code block:
{ }% For each unit length:
md Perform modular division with the topmost integers on the stack.
\ Swap quotient and residue.
Collect the results in an array.
W< Discard the last quotient.
Javascript ES6, 34 bytes
F=(q,a)=>a.map(u=>[q%u|0,q/=u][0])
Explanation:
F=(q,a)=>a.map(u=>
// For each unit
[
q%u|0, // floored remainder of q / u
q/=u // set q to quotient of q / u
][0] // return remainder
)