def Internaldate2epoch(resp):
 from calendar import timegm
 mo = InternalDate.match(resp)
 if (not mo):
  return None
 mon = Mon2num[mo.group('mon')]
 zonen = mo.group('zonen')
 day = int(mo.group('day'))
 year = int(mo.group('year'))
 hour = int(mo.group('hour'))
 min = int(mo.group('min'))
 sec = int(mo.group('sec'))
 zoneh = int(mo.group('zoneh'))
 zonem = int(mo.group('zonem'))
 zone = (((zoneh * 60) + zonem) * 60)
 if (zonen == '-'):
  zone = (- zone)
 tt = (year, mon, day, hour, min, sec, (-1), (-1), (-1))
 return (timegm(tt) - zone)

def Internaldate2epoch ( resp ) : from calendar import timegm mo = InternalDate . match ( resp ) if ( not mo ) : return None mon = Mon2num [ mo . group ( 'mon' ) ] zonen = mo . group ( 'zonen' ) day = int ( mo . group ( 'day' ) ) year = int ( mo . group ( 'year' ) ) hour = int ( mo . group ( 'hour' ) ) min = int ( mo . group ( 'min' ) ) sec = int ( mo . group ( 'sec' ) ) zoneh = int ( mo . group ( 'zoneh' ) ) zonem = int ( mo . group ( 'zonem' ) ) zone = ( ( ( zoneh * 60 ) + zonem ) * 60 ) if ( zonen == '-' ) : zone = ( - zone ) tt = ( year , mon , day , hour , min , sec , ( - 1 ) , ( - 1 ) , ( - 1 ) ) return ( timegm ( tt ) - zone )
convert imap4 internaldate to ut .