def Internaldate2tuple(resp):
 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))
 utc = time.mktime(tt)
 lt = time.localtime(utc)
 if (time.daylight and lt[(-1)]):
  zone = (zone + time.altzone)
 else:
  zone = (zone + time.timezone)
 return time.localtime((utc - zone))

def Internaldate2tuple ( resp ) : 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 ) ) utc = time . mktime ( tt ) lt = time . localtime ( utc ) if ( time . daylight and lt [ ( - 1 ) ] ) : zone = ( zone + time . altzone ) else : zone = ( zone + time . timezone ) return time . localtime ( ( utc - zone ) )
parse an imap4 internaldate string .