/**
   * Compare algorithm described in dateDime (3.2.7). Duration datatype overwrites this method
   *
   * @param date1 normalized date representation of the first value
   * @param date2 normalized date representation of the second value
   * @param strict
   * @return less, greater, less_equal, greater_equal, equal
   */
  protected short compareDates(DateTimeData date1, DateTimeData date2, boolean strict) {
    if (date1.utc == date2.utc) {
      return compareOrder(date1, date2);
    }
    short c1, c2;

    DateTimeData tempDate = new DateTimeData(null, this);

    if (date1.utc == 'Z') {

      // compare date1<=date1<=(date2 with time zone -14)
      //
      cloneDate(date2, tempDate); // clones date1 value to global temporary storage: fTempDate
      tempDate.timezoneHr = 14;
      tempDate.timezoneMin = 0;
      tempDate.utc = '+';
      normalize(tempDate);
      c1 = compareOrder(date1, tempDate);
      if (c1 == LESS_THAN) return c1;

      // compare date1>=(date2 with time zone +14)
      //
      cloneDate(date2, tempDate); // clones date1 value to global temporary storage: tempDate
      tempDate.timezoneHr = -14;
      tempDate.timezoneMin = 0;
      tempDate.utc = '-';
      normalize(tempDate);
      c2 = compareOrder(date1, tempDate);
      if (c2 == GREATER_THAN) return c2;

      return INDETERMINATE;
    } else if (date2.utc == 'Z') {

      // compare (date1 with time zone -14)<=date2
      //
      cloneDate(date1, tempDate); // clones date1 value to global temporary storage: tempDate
      tempDate.timezoneHr = -14;
      tempDate.timezoneMin = 0;
      tempDate.utc = '-';
      if (DEBUG) {
        System.out.println("tempDate=" + dateToString(tempDate));
      }
      normalize(tempDate);
      c1 = compareOrder(tempDate, date2);
      if (DEBUG) {
        System.out.println("date=" + dateToString(date2));
        System.out.println("tempDate=" + dateToString(tempDate));
      }
      if (c1 == LESS_THAN) return c1;

      // compare (date1 with time zone +14)<=date2
      //
      cloneDate(date1, tempDate); // clones date1 value to global temporary storage: tempDate
      tempDate.timezoneHr = 14;
      tempDate.timezoneMin = 0;
      tempDate.utc = '+';
      normalize(tempDate);
      c2 = compareOrder(tempDate, date2);
      if (DEBUG) {
        System.out.println("tempDate=" + dateToString(tempDate));
      }
      if (c2 == GREATER_THAN) return c2;

      return INDETERMINATE;
    }
    return INDETERMINATE;
  }