def http2time(text):
 m = strict_re.search(text)
 if m:
  g = m.groups()
  mon = (months_lower.index(g[1].lower()) + 1)
  tt = (int(g[2]), mon, int(g[0]), int(g[3]), int(g[4]), float(g[5]))
  return my_timegm(tt)
 text = text.lstrip()
 text = wkday_re.sub('', text, 1)
 (day, mon, yr, hr, min, sec, tz) = ([None] * 7)
 m = loose_http_re.search(text)
 if (m is not None):
  (day, mon, yr, hr, min, sec, tz) = m.groups()
 else:
  return None
 return _str2time(day, mon, yr, hr, min, sec, tz)

def http2time ( text ) : m = strict_re . search ( text ) if m : g = m . groups ( ) mon = ( months_lower . index ( g [ 1 ] . lower ( ) ) + 1 ) tt = ( int ( g [ 2 ] ) , mon , int ( g [ 0 ] ) , int ( g [ 3 ] ) , int ( g [ 4 ] ) , float ( g [ 5 ] ) ) return my_timegm ( tt ) text = text . lstrip ( ) text = wkday_re . sub ( '' , text , 1 ) ( day , mon , yr , hr , min , sec , tz ) = ( [ None ] * 7 ) m = loose_http_re . search ( text ) if ( m is not None ) : ( day , mon , yr , hr , min , sec , tz ) = m . groups ( ) else : return None return _str2time ( day , mon , yr , hr , min , sec , tz )
returns time in seconds since epoch of time represented by a string .