MCPcopy Index your code
hub / github.com/clips/pattern / __extract_tzd

Function __extract_tzd

pattern/web/feed/feedparser.py:3412–3430  ·  view source on GitHub ↗

Return the Time Zone Designator as an offset in seconds from UTC.

(m)

Source from the content-addressed store, hash-verified

3410 return hours, minutes, seconds
3411
3412 def __extract_tzd(m):
3413 '''Return the Time Zone Designator as an offset in seconds from UTC.'''
3414 if not m:
3415 return 0
3416 tzd = m.group('tzd')
3417 if not tzd:
3418 return 0
3419 if tzd == 'Z':
3420 return 0
3421 hours = int(m.group('tzdhours'))
3422 minutes = m.group('tzdminutes')
3423 if minutes:
3424 minutes = int(minutes)
3425 else:
3426 minutes = 0
3427 offset = (hours*60 + minutes) * 60
3428 if tzd[0] == '+':
3429 return -offset
3430 return offset
3431
3432 __date_re = ('(?P<year>\d\d\d\d)'
3433 '(?:(?P<dsep>-|)'

Callers 1

_parse_date_w3dtfFunction · 0.85

Calls 1

groupMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…