MCPcopy Index your code
hub / github.com/python/cpython / offset_from_tz_string

Function offset_from_tz_string

Lib/http/cookiejar.py:136–148  ·  view source on GitHub ↗
(tz)

Source from the content-addressed store, hash-verified

134
135TIMEZONE_RE = re.compile(r"^([-+])?(\d\d?):?(\d\d)?$", re.ASCII)
136def offset_from_tz_string(tz):
137 offset = None
138 if tz in UTC_ZONES:
139 offset = 0
140 else:
141 m = TIMEZONE_RE.search(tz)
142 if m:
143 offset = 3600 * int(m.group(2))
144 if m.group(3):
145 offset = offset + 60 * int(m.group(3))
146 if m.group(1) == '-':
147 offset = -offset
148 return offset
149
150def _str2time(day, mon, yr, hr, min, sec, tz):
151 yr = int(yr)

Callers 1

_str2timeFunction · 0.85

Calls 2

searchMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…