def AmericanDateToEpoch(date_str):
 try:
  epoch = time.strptime(date_str, '%m/%d/%Y')
  return (int(calendar.timegm(epoch)) * 1000000)
 except ValueError:
  return 0

def AmericanDateToEpoch ( date_str ) : try : epoch = time . strptime ( date_str , '%m/%d/%Y' ) return ( int ( calendar . timegm ( epoch ) ) * 1000000 ) except ValueError : return 0
take a us format date and return epoch .