def time_to_text(t):
    """Convert time to text."""
    if t <= 0:
        return '--:--'
    elif t < 3600:
        minutes = t // 60
        seconds = t % 60
        return '{:02d}:{:02d}'.format(minutes, seconds)
    else:
        hours = t // 3600
        minutes = t % 3600 // 60
        seconds = t % 60
        return '{:d}:{:02d}:{:02d}'.format(hours, minutes, seconds)
