<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def date_to_knx(dateval):
 """Convert a date to a 3 byte KNX data array"""


    if (dateval.year < 1990) or (dateval.year > 2089):
        raise KNXException("Year has to be between 1990 and 2089")

    if dateval.year < 2000:
        year = dateval.year - 1900
    else:
        year = dateval.year - 2000

    return([dateval.day, dateval.month, year])