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