Parse a string according to the Nate 8-bit date format
(dateString)
| 3082 | registerDateHandler(_parse_date_onblog) |
| 3083 | |
| 3084 | def _parse_date_nate(dateString): |
| 3085 | '''Parse a string according to the Nate 8-bit date format''' |
| 3086 | m = _korean_nate_date_re.match(dateString) |
| 3087 | if not m: return |
| 3088 | hour = int(m.group(5)) |
| 3089 | ampm = m.group(4) |
| 3090 | if (ampm == _korean_pm): |
| 3091 | hour += 12 |
| 3092 | hour = str(hour) |
| 3093 | if len(hour) == 1: |
| 3094 | hour = '0' + hour |
| 3095 | w3dtfdate = '%(year)s-%(month)s-%(day)sT%(hour)s:%(minute)s:%(second)s%(zonediff)s' % \ |
| 3096 | {'year': m.group(1), 'month': m.group(2), 'day': m.group(3),\ |
| 3097 | 'hour': hour, 'minute': m.group(6), 'second': m.group(7),\ |
| 3098 | 'zonediff': '+09:00'} |
| 3099 | if _debug: sys.stderr.write('Nate date parsed as: %s\n' % w3dtfdate) |
| 3100 | return _parse_date_w3dtf(w3dtfdate) |
| 3101 | registerDateHandler(_parse_date_nate) |
| 3102 | |
| 3103 | _mssql_date_re = \ |
nothing calls this directly
no test coverage detected