143
142
if RE_PATCHDATE_NOOFFSET.match(date_str) is not None:
144
143
raise ValueError("time data %r is missing a timezone offset"
149
148
secs_str = match.group(1)
150
149
offset_hours, offset_mins = int(match.group(2)), int(match.group(3))
151
150
if abs(offset_hours) >= 24 or offset_mins >= 60:
152
151
raise ValueError("invalid timezone %r" %
154
153
offset = offset_hours * 3600 + offset_mins * 60
155
154
tm_time = time.strptime(secs_str, '%Y-%m-%d %H:%M:%S')
156
155
# adjust seconds according to offset before converting to POSIX