def getSeconds(strTime):
 try:
  x = dt.strptime(strTime, '%H:%M:%S')
  seconds = int(timedelta(hours=x.hour, minutes=x.minute, seconds=x.second).total_seconds())
 except ValueError:
  seconds = 0
 if (seconds < 0):
  seconds = 0
 return seconds

def getSeconds ( strTime ) : try : x = dt . strptime ( strTime , '%H:%M:%S' ) seconds = int ( timedelta ( hours = x . hour , minutes = x . minute , seconds = x . second ) . total_seconds ( ) ) except ValueError : seconds = 0 if ( seconds < 0 ) : seconds = 0 return seconds
return the duration in seconds of a time string .