FUNCTION format_time,mins IF (mins LT 0) THEN BEGIN time_str='00:00:00' RETURN,time_str ENDIF IF (mins GT 1440) THEN mins=mins-1440 qhr=LONG(mins)/60 qmn=LONG(mins-(60*qhr)) qsc=(mins - fix(mins)) * 60 time_str=STRING(qhr,qmn,qsc,FORMAT="(i2.2,':',i2.2,':',i2.2)") RETURN,time_str END