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? Answer Here’s a fun hacky way to do exactly what you are looking for =) Explanation: The date utility allows you to specify a time, from string, in seconds since 1970-01-01