from datetime import datetime


def extract_date(date, feature_data):
    """Convert Date in a vector normalized.

    Params:
        date (string): the date string
        feature_data (dict): information about the year. 'max_year', 'min_year'
                             and 'year_range'

    Returns:
        list of float
    """
    tmp = datetime.strptime(date, "%Y-%m-%d %H:%M:%S")
    result = []

    result.append(
        (tmp.year - feature_data['min_year']) / feature_data['year_range'])
    result.append(tmp.month / 12.)
    result.append(tmp.day / 31.)
    result.append(tmp.hour / 24.)
    result.append(tmp.minute / 60.)

    return result