def format_time( t ):
    """ format seconds as mm:ss """
    m,s = divmod(t,60)
    if m > 59:
        h,m = divmod(m,60)
        return "%d:%02d:%02d"%(h,m,s)
    else:
        return "%d:%02d"%(m,s)