def _convert_time(date_str, time_str):
 for fmt in ('%d/%m/%Y', '%d-%b-%Y', '%a, %b %d, %Y'):
  try:
   date = strptime(date_str, fmt)
  except ValueError:
   pass
  else:
   break
 else:
  raise RuntimeError(('Illegal date: %s.\nIf the language of the date does not correspond to your local machine\'s language try to set the locale to the language of the date string:\nlocale.setlocale(locale.LC_ALL, "en_US")' % date_str))
 for fmt in ('%H:%M:%S', '%H:%M'):
  try:
   time = strptime(time_str, fmt)
  except ValueError:
   pass
  else:
   break
 else:
  raise RuntimeError(('Illegal time: %s' % time_str))
 res = timegm((date.tm_year, date.tm_mon, date.tm_mday, time.tm_hour, time.tm_min, time.tm_sec, date.tm_wday, date.tm_yday, date.tm_isdst))
 return res

def _convert_time ( date_str , time_str ) : for fmt in ( '%d/%m/%Y' , '%d-%b-%Y' , '%a, %b %d, %Y' ) : try : date = strptime ( date_str , fmt ) except ValueError : pass else : break else : raise RuntimeError ( ( 'Illegal date: %s.\nIf the language of the date does not correspond to your local machine\'s language try to set the locale to the language of the date string:\nlocale.setlocale(locale.LC_ALL, "en_US")' % date_str ) ) for fmt in ( '%H:%M:%S' , '%H:%M' ) : try : time = strptime ( time_str , fmt ) except ValueError : pass else : break else : raise RuntimeError ( ( 'Illegal time: %s' % time_str ) ) res = timegm ( ( date . tm_year , date . tm_mon , date . tm_mday , time . tm_hour , time . tm_min , time . tm_sec , date . tm_wday , date . tm_yday , date . tm_isdst ) ) return res
convert date and time strings to float time .