(resp)
return time.localtime(utc)
Parse an IMAP4 INTERNALDATE string.

    Return corresponding local time.  The return value is a
    time.struct_time tuple or None if the string has wrong format.
Parse an IMAP4 INTERNALDATE string.
Parse an IMAP4 INTERNALDATE string .
def Internaldate2tuple(resp):
    """Parse an IMAP4 INTERNALDATE string.

    Return corresponding local time.  The return value is a
    time.struct_time tuple or None if the string has wrong format.
    """

    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'))

    # INTERNALDATE timezone must be subtracted to get UT

    zone = (zoneh*60 + zonem)*60
    if zonen == b'-':
        zone = -zone

    tt = (year, mon, day, hour, min, sec, -1, -1, -1)
    utc = calendar.timegm(tt) - zone

    return time.localtime(utc)
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' ) ) # INTERNALDATE timezone must be subtracted to get UT zone = ( zoneh * 60 + zonem ) * 60 if zonen == b'-' : zone = - zone tt = ( year , mon , day , hour , min , sec , - 1 , - 1 , - 1 ) utc = calendar . timegm ( tt ) - zone return time . localtime ( utc )