code: def _date_by_len(self, string):
          
  
          strlen = len(string)
  
          date_format = None
          if strlen == 10:
              date_format = '%Y%m%d%H'
          elif strlen == 12:
              date_format = '%Y%m%d%H%M'
          elif strlen == 14:
              date_format = '%Y%m%d%H%M%S'
          elif strlen == 18:
              date_format = '%Y%m%d%H%M%S.%f'
  
          if date_format:
              if len(string) >= 4 and string[0:4] == '0000':
                  # Year 2000 shares a calendar with year 0, and is supported natively
                  t = datetime.strptime('2000' + string[4:], date_format)
                  return extended_datetime(
                      0,
                      t.month,
                      t.day,
                      t.hour,
                      t.minute,
                      t.second,
                      t.microsecond,
                      t.tzinfo
                  )
              return datetime.strptime(string, date_format)
  
          return string
docs: Parses a date from a string based on its length
  
          :param string:
              A unicode string to parse
  
          :return:
              A datetime.datetime object, asn1crypto.util.extended_datetime object or
              a unicode string