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

Function _parse_date_perforce

pattern/web/feed/feedparser.py:3536–3550  ·  view source on GitHub ↗

parse a date in yyyy/mm/dd hh:mm:ss TTT format

(aDateString)

Source from the content-addressed store, hash-verified

3534registerDateHandler(_parse_date_asctime)
3535
3536def _parse_date_perforce(aDateString):
3537 """parse a date in yyyy/mm/dd hh:mm:ss TTT format"""
3538 # Fri, 2006/09/15 08:19:53 EDT
3539 _my_date_pattern = re.compile( \
3540 r'(\w{,3}), (\d{,4})/(\d{,2})/(\d{2}) (\d{,2}):(\d{2}):(\d{2}) (\w{,3})')
3541
3542 m = _my_date_pattern.search(aDateString)
3543 if m is None:
3544 return None
3545 dow, year, month, day, hour, minute, second, tz = m.groups()
3546 months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
3547 dateString = "%s, %s %s %s %s:%s:%s %s" % (dow, day, months[int(month) - 1], year, hour, minute, second, tz)
3548 tm = rfc822.parsedate_tz(dateString)
3549 if tm:
3550 return time.gmtime(rfc822.mktime_tz(tm))
3551registerDateHandler(_parse_date_perforce)
3552
3553def _parse_date(dateString):

Callers

nothing calls this directly

Calls 1

searchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…