private Calendar addMonth(Timestamp ts, int numMonths) {
    calendar.setTimeInMillis(ts.toEpochMilli());

    return addMonth(numMonths);
  }
GenericUDFAddMonths.

Add a number of months to the date. The time part of the string will be
ignored.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAddMonths.java