def fromRFC2822(klass, rfc822string):
<EOL>maybeStructTimePlus = parsedate_tz(rfc822string)<EOL>if maybeStructTimePlus is None:<EOL><INDENT>raise ValueError('<STR_LIT>' % (rfc822string,))<EOL><DEDENT>structTimePlus = sanitizeStructTime(maybeStructTimePlus)<EOL>offsetInSeconds = structTimePlus[-<NUM_LIT:1>]<EOL>if offsetInSeconds is None:<EOL><INDENT>offsetInSeconds = <NUM_LIT:0><EOL><DEDENT>self = klass.fromStructTime(<EOL>structTimePlus,<EOL>FixedOffset(<EOL>hours=<NUM_LIT:0>,<EOL>minutes=offsetInSeconds // <NUM_LIT>))<EOL>self.resolution = datetime.timedelta(seconds=<NUM_LIT:1>)<EOL>return self<EOL>
Return a new Time instance from a string formated as described in RFC 2822.

@type rfc822string: str

@raise ValueError: if the timestamp is not formatted properly (or if
certain obsoleted elements of the specification are used).

@return: a new L{Time}