#! /usr/bin/python # To change this template, choose Tools | Templates # and open the template in the editor. __author__="bjschuma" __date__ ="$Mar 16, 2010 7:36:48 PM$" def ftime(time,ms=True): time = int(time) # Convert to seconds if we were given milliseconds if ms==True: time = time/1000000000 #print time # Find hour length = "" if time >= 3600: hour = time/3600 time = time - (hour * 3600) if hour > 0: length=str(hour)+":" # Find minute if time >= 60: min = time/60 time = time - (min * 60) if min < 10: length+="0" length+=str(min)+":" else: length+="00:" # Remainder is seconds sec = time if sec < 10: length+="0" length+=str(sec) return length