def parse_iso8601_datetime(string):
<EOL>match = _RE_ISO8601_DATETIME.search(string)<EOL>if not match:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>year = int(match.group('<STR_LIT>'))<EOL>month = int(match.group('<STR_LIT>'))<EOL>day = int(match.group('<STR_LIT>'))<EOL>hour = int(match.group('<STR_LIT>')) if match.group('<STR_LIT>') else <NUM_LIT:0><EOL>minute = int(match.group('<STR_LIT>')) if match.group('<STR_LIT>') else <NUM_LIT:0><EOL>sec = int(match.group('<STR_LIT>')) if match.group('<STR_LIT>') else <NUM_LIT:0><EOL>microsec = int(float('<STR_LIT:.>' + match.group('<STR_LIT>')) * <NUM_LIT>) if match.group('<STR_LIT>') else <NUM_LIT:0><EOL>offhour = int(match.group('<STR_LIT>') + match.group('<STR_LIT>')) if match.group('<STR_LIT>') else <NUM_LIT:0><EOL>offmin = int(match.group('<STR_LIT>') + match.group('<STR_LIT>')) if match.group('<STR_LIT>') else <NUM_LIT:0><EOL>return (datetime(year, month, day, hour, minute, sec, microsec, TZUTC) -<EOL>timedelta(hours=offhour, minutes=offmin))<EOL>
Parse an ISO 8601 date/time string