I have a variable of $i which is seconds in a shell script, and I am trying to convert it to 24 HOUR HH:MM:SS. Is this possible in shell?
Another approach: arithmetic
i=6789 ((sec=i%60, i/=60, min=i%60, hrs=i/60)) timestamp=$(printf "%d:%02d:%02d" $hrs $min $sec) echo $timestamp
produces 1:53:09
1:53:09