public Calendar calendarChange(Calendar c, boolean add) {
    int a = 1;
    if (!add) {
      a = -1;
    }
    if (days != 0) {
      c.add(Calendar.DAY_OF_MONTH, days * a);
    }
    if (milliseconds != 0) {
      c.setTimeInMillis(c.getTimeInMillis() + milliseconds * a);
    }
    return c;
  }
Add interval value to the specified Calendar value
hplsql/src/main/java/org/apache/hive/hplsql/Interval.java