def tmstr(tm):
    """Format input time in seconds as minute:seconds string."""

    tmstr = []

    t = tm/60.0/60.0
    hrs = int(t)
    if hrs:
        tmstr.append('{:d} hrs '.format(hrs))

    t = (t-hrs)*60.0
    mins = int(t)
    if mins:
        tmstr.append('{:d} min '.format(mins))

    secs = (t-mins)*60.0
    #tmstr.append('{:.1g} sec'.format(secs))
    if int(secs*10000):
        tmstr.append('{:.2f} sec'.format(secs))
    else:
        tmstr.append('{:.0e} sec'.format(secs))

    return ''.join(tmstr)