public int compareDateTo(DateTime date) {
        if (this._year == date.getYear()) {
            if (this._month == date.getMonth()) {
                if (this._day == date.getDay()) {
                    return 0; // equal
                }
                else if (this._day > date.getDay()) {
                    return 1; // greater
                }
                else {
                    return -1; // smaller
                }
            }
            else if (this._month > date.getMonth()) {
                return 1; // greater
            }
            else {
                return -1; // smaller
            }
        }
        else if (this._year > date.getYear()) {
            return 1; // greater
        }
        else {
            return -1; // smaller
        }
    }