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

Function _parse_date_hungarian

pattern/web/feed/feedparser.py:3329–3345  ·  view source on GitHub ↗

Parse a string according to a Hungarian 8-bit date format.

(dateString)

Source from the content-addressed store, hash-verified

3327 re.compile(u'(\d{4})-([^-]+)-(\d{,2})T(\d{,2}):(\d{2})((\+|-)(\d{,2}:\d{2}))')
3328
3329def _parse_date_hungarian(dateString):
3330 '''Parse a string according to a Hungarian 8-bit date format.'''
3331 m = _hungarian_date_format_re.match(dateString)
3332 if not m or m.group(2) not in _hungarian_months:
3333 return None
3334 month = _hungarian_months[m.group(2)]
3335 day = m.group(3)
3336 if len(day) == 1:
3337 day = '0' + day
3338 hour = m.group(4)
3339 if len(hour) == 1:
3340 hour = '0' + hour
3341 w3dtfdate = '%(year)s-%(month)s-%(day)sT%(hour)s:%(minute)s%(zonediff)s' % \
3342 {'year': m.group(1), 'month': month, 'day': day,\
3343 'hour': hour, 'minute': m.group(5),\
3344 'zonediff': m.group(6)}
3345 return _parse_date_w3dtf(w3dtfdate)
3346registerDateHandler(_parse_date_hungarian)
3347
3348# W3DTF-style date parsing adapted from PyXML xml.utils.iso8601, written by

Callers

nothing calls this directly

Calls 4

lenFunction · 0.85
_parse_date_w3dtfFunction · 0.85
matchMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…