Parse a string according to a Hungarian 8-bit date format.
(dateString)
| 3327 | re.compile(u'(\d{4})-([^-]+)-(\d{,2})T(\d{,2}):(\d{2})((\+|-)(\d{,2}:\d{2}))') |
| 3328 | |
| 3329 | def _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) |
| 3346 | registerDateHandler(_parse_date_hungarian) |
| 3347 | |
| 3348 | # W3DTF-style date parsing adapted from PyXML xml.utils.iso8601, written by |
nothing calls this directly
no test coverage detected
searching dependent graphs…