code: def parseDateText(self, dateString):
          
          yr, mth, dy, hr, mn, sec, wd, yd, isdst = time.localtime()
  
          currentMth = mth
          currentDy  = dy
  
          s   = dateString.lower()
          m   = self.ptc.CRE_DATE3.search(s)
          mth = m.group('mthname')
          mth = self.ptc.MonthOffsets[mth]
  
          if m.group('day') !=  None:
              dy = int(m.group('day'))
          else:
              dy = 1
  
          if m.group('year') !=  None:
              yr = int(m.group('year'))
  
              # birthday epoch constraint
              if yr < self.ptc.BirthdayEpoch:
                  yr += 2000
              elif yr < 100:
                  yr += 1900
  
          elif (mth < currentMth) or (mth == currentMth and dy < currentDy):
              # if that day and month have already passed in this year,
              # then increment the year by 1
              yr += 1
  
          if dy > 0 and dy <= self.ptc.daysInMonth(mth, yr):
              sourceTime = (yr, mth, dy, hr, mn, sec, wd, yd, isdst)
          else:
              # Return current time if date string is invalid
              self.dateFlag = 0
              self.timeFlag = 0
              sourceTime    = time.localtime()
  
          return sourceTime
docs: Parse long-form date strings::
  
              'May 31st, 2006'
              'Jan 1st'
              'July 2006'
  
          @type  dateString: string
          @param dateString: text to convert to a datetime
  
          @rtype:  struct_time
          @return: calculated C{struct_time} value of dateString