MCPcopy Index your code
hub / github.com/pyload/pyload / _parse_date_perforce

Function _parse_date_perforce

module/lib/feedparser.py:3341–3353  ·  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

3339registerDateHandler(_parse_date_rfc822)
3340
3341def _parse_date_perforce(aDateString):
3342 """parse a date in yyyy/mm/dd hh:mm:ss TTT format"""
3343 # Fri, 2006/09/15 08:19:53 EDT
3344 _my_date_pattern = re.compile( \
3345 r'(\w{,3}), (\d{,4})/(\d{,2})/(\d{2}) (\d{,2}):(\d{2}):(\d{2}) (\w{,3})')
3346
3347 dow, year, month, day, hour, minute, second, tz = \
3348 _my_date_pattern.search(aDateString).groups()
3349 months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
3350 dateString = "%s, %s %s %s %s:%s:%s %s" % (dow, day, months[int(month) - 1], year, hour, minute, second, tz)
3351 tm = rfc822.parsedate_tz(dateString)
3352 if tm:
3353 return time.gmtime(rfc822.mktime_tz(tm))
3354registerDateHandler(_parse_date_perforce)
3355
3356def _parse_date(dateString):

Callers

nothing calls this directly

Calls 2

compileMethod · 0.80
searchMethod · 0.45

Tested by

no test coverage detected