Consider the following python code. Write a code to modify this such that it generates the output shown.
def get_year_from_date(date):
    year = date.split('-')[0]
    return int(year)
def get_year_from_date(date):
    """
    This function takes a string date in the form of a yyyy-mm-dd and returns the year as an integer
    """
    year = date.split('-')[0]
    return int(year)