def _parse_date_perforce(aDateString):
 _my_date_pattern = re.compile(u'(\\w{,3}), (\\d{,4})/(\\d{,2})/(\\d{2}) (\\d{,2}):(\\d{2}):(\\d{2}) (\\w{,3})')
 m = _my_date_pattern.search(aDateString)
 if (m is None):
  return None
 (dow, year, month, day, hour, minute, second, tz) = m.groups()
 months = [u'Jan', u'Feb', u'Mar', u'Apr', u'May', u'Jun', u'Jul', u'Aug', u'Sep', u'Oct', u'Nov', u'Dec']
 dateString = (u'%s, %s %s %s %s:%s:%s %s' % (dow, day, months[(int(month) - 1)], year, hour, minute, second, tz))
 tm = rfc822.parsedate_tz(dateString)
 if tm:
  return time.gmtime(rfc822.mktime_tz(tm))

def _parse_date_perforce ( aDateString ) : _my_date_pattern = re . compile ( u'(\\w{,3}), (\\d{,4})/(\\d{,2})/(\\d{2}) (\\d{,2}):(\\d{2}):(\\d{2}) (\\w{,3})' ) m = _my_date_pattern . search ( aDateString ) if ( m is None ) : return None ( dow , year , month , day , hour , minute , second , tz ) = m . groups ( ) months = [ u'Jan' , u'Feb' , u'Mar' , u'Apr' , u'May' , u'Jun' , u'Jul' , u'Aug' , u'Sep' , u'Oct' , u'Nov' , u'Dec' ] dateString = ( u'%s, %s %s %s %s:%s:%s %s' % ( dow , day , months [ ( int ( month ) - 1 ) ] , year , hour , minute , second , tz ) ) tm = rfc822 . parsedate_tz ( dateString ) if tm : return time . gmtime ( rfc822 . mktime_tz ( tm ) )
parse a date in yyyy/mm/dd hh:mm:ss ttt format .