def secs2time(secs):
    """Converts integer number of seconds to a time string of format hh:mm:ss."""
    h = secs//(60*60)
    m = (secs-h*60*60)//60
    s = secs-(h*60*60)-(m*60)
    x = [ h, m, s ]
    for i in range(len(x)):
        if x[i] < 10:
            x[i] = '0' + str(x[i])
        x[i] = str(x[i])
    return ':'.join(x)