code: public long set(long instant, int month) {
          FieldUtils.verifyValueBounds(this, month, MIN, iMax);
          //
          int thisYear = iChronology.getYear(instant);
          //
          int thisDom = iChronology.getDayOfMonth(instant, thisYear);
          int maxDom = iChronology.getDaysInYearMonth(thisYear, month);
          if (thisDom > maxDom) {
              // Quietly force DOM to nearest sane value.
              thisDom = maxDom;
          }
          // Return newly calculated millis value
          return iChronology.getYearMonthDayMillis(thisYear, month, thisDom) +
              iChronology.getMillisOfDay(instant);
      }
docs: Set the Month component of the specified time instant.<p>
  If the new month has less total days than the specified
  day of the month, this value is coerced to the nearest
  sane value. e.g.<p>
  07-31 to month 6 = 06-30<p>
  03-31 to month 2 = 02-28 or 02-29 depending<p>
  
  @param instant  the time instant in millis to update.
  @param month  the month (1,12) to update the time to.
  @return the updated time instant.
  @throws IllegalArgumentException  if month is invalid