public static Date parseDate(
            final String dateValue,
            final String[] dateFormats,
            final Date startDate) {
        Args.notNull(dateValue, "Date value");
        final String[] localDateFormats = dateFormats != null ? dateFormats : DEFAULT_PATTERNS;
        final Date localStartDate = startDate != null ? startDate : DEFAULT_TWO_DIGIT_YEAR_START;
        String v = dateValue;
        // trim single quotes around date if present
        // see issue #5279
        if (v.length() > 1 && v.startsWith("'") && v.endsWith("'")) {
            v = v.substring (1, v.length() - 1);
        }

        for (final String dateFormat : localDateFormats) {
            final SimpleDateFormat dateParser = DateFormatHolder.formatFor(dateFormat);
            dateParser.set2DigitYearStart(localStartDate);
            final ParsePosition pos = new ParsePosition(0);
            final Date result = dateParser.parse(v, pos);
            if (pos.getIndex() != 0) {
                return result;
            }
        }
        return null;
    }
Parses the date value using the given date formats.

@param dateValue the date value to parse
@param dateFormats the date formats to use
@param startDate During parsing, two digit years will be placed in the range
{@code startDate} to {@code startDate + 100 years}. This value may
be {@code null}. When {@code null} is given as a parameter, year
{@code 2000} will be used.

@return the parsed date or null if input could not be parsed
ngrinder-runtime/src/main/java/org/apache/hc/client5/http/utils/DateUtils.java