I would like to turn a number-of-seconds-since midnight into an HH:MM:SS formatted string.
For example, the number 17672
should turn into the string '04:54:32'
. I can do the math to get the integer components, like so:
T←17672
H←⌊T÷3600
MS←3600|T
M←⌊MS÷60
S←60|T
H M S
4 54 32
But I do not know how to join the three components of this array into a string (separated by colons), and left pad each time component with a zero. For example, I would want
6 0 8
to be '06:00:08'
.
I can use either GNU APL or the online ngn-apl