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

Function _parse_date_nate

pattern/web/feed/feedparser.py:3238–3254  ·  view source on GitHub ↗

Parse a string according to the Nate 8-bit date format

(dateString)

Source from the content-addressed store, hash-verified

3236registerDateHandler(_parse_date_onblog)
3237
3238def _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)
3255registerDateHandler(_parse_date_nate)
3256
3257# Unicode strings for Greek date strings

Callers

nothing calls this directly

Calls 5

strFunction · 0.85
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…