def time_string(t):
    """ Return a string of format 'hh:mm:ss', representing time t in seconds 
        Result rounded to nearest second.
    """
    seconds = int(round(t))
    h,rsecs = divmod(seconds,3600)
    m,s = divmod(rsecs,60)
    return str(h).zfill(2) + ":" + str(m).zfill(2) + ":" + str(s).zfill(2)