def date_parser(dates):
    """Date Parser - changes dates to date format 'yyyy-mm-dd'  
    
    Parameters
    ----------
    dates: list of dates and times strings in the format 'yyyy-mm-dd hh:mm:ss'
    
    Returns
    -------
    list:
         A list of only the dates in 'yyyy-mm-dd' format.
    """
    data_format = []                 #Empty list.
    for i in dates:                  #Iterate over elements of dates.
        x =  i.split(" ")[0]         #Split the strings in dates to get rid of the times.
        data_format.append(x)        #append splitted strings to the empty list 'data_format'
                                      
        
     
    return data_format               #Return the new list 'data_format'.