Parse a string according to the Nate 8-bit date format
(dateString)
| 3236 | registerDateHandler(_parse_date_onblog) |
| 3237 | |
| 3238 | def _parse_date_nate(dateString): |
| 3239 | '''Parse a string according to the Nate 8-bit date format''' |
| 3240 | m = _korean_nate_date_re.match(dateString) |
| 3241 | if not m: |
| 3242 | return |
| 3243 | hour = int(m.group(5)) |
| 3244 | ampm = m.group(4) |
| 3245 | if (ampm == _korean_pm): |
| 3246 | hour += 12 |
| 3247 | hour = str(hour) |
| 3248 | if len(hour) == 1: |
| 3249 | hour = '0' + hour |
| 3250 | w3dtfdate = '%(year)s-%(month)s-%(day)sT%(hour)s:%(minute)s:%(second)s%(zonediff)s' % \ |
| 3251 | {'year': m.group(1), 'month': m.group(2), 'day': m.group(3),\ |
| 3252 | 'hour': hour, 'minute': m.group(6), 'second': m.group(7),\ |
| 3253 | 'zonediff': '+09:00'} |
| 3254 | return _parse_date_w3dtf(w3dtfdate) |
| 3255 | registerDateHandler(_parse_date_nate) |
| 3256 | |
| 3257 | # Unicode strings for Greek date strings |
nothing calls this directly
no test coverage detected
searching dependent graphs…