You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
254 B
Plaintext

sec2hr () {
local sec="$1"
local hours=$(( "${sec}" / 3600 ))
local remainder=$(( "${sec}" % 3600))
local minutes=$(( "${remainder}" / 60 ))
local seconds=$(( "${sec}" % 60))
printf "%02d:%02d:%02d\n" "${hours}" "${minutes}" "${seconds}"
}