def find_start_end_dates(dates1, dates2):
    """Find start and end dates between lists (or arrays) of datetime objects
    that do not have the same length.

    The start date will be the later of two dates.

    The end date will be the earlier of the two dates.

    :param dates1: List or array of datetime objects
    :type dates1: list or numpy.ndarray
    :param dates2: List or array of datetime objects
    :type dates2: list or numpy.ndarray
    :returns: Tuple of start date and end date
    :rtype: tuple
    :raises: ValueError for non overlapping dates
    """
    # convert dates to sets for set intersection
    date1_set = set(dates1)
    date2_set = set(dates2)
    if date1_set.intersection(date2_set):
        # start date
        if dates2[0] > dates1[0]:
            start_date = dates2[0]
        else:
            start_date = dates1[0]

        # end date
        if dates2[-1] > dates1[-1]:
            end_date = dates1[-1]
        else:
            end_date = dates2[-1]

        return start_date, end_date
    else:
       raise ValueError("No overlapping dates.")