def format_time(tm):
    """
    convert time from `{seconds}` to `{hh:mm:ss}`;
    """
    if tm.isdigit():
        tm = int(tm)
        h, m, s = tm // 3600, tm // 60 % 60, tm % 60
        return '{}:'.format(h) * bool(h > 0) + '{:02d}:{:02d}'.format(m, s)
    else:
        return ''
