code: public static Date getLastDayFromCurrentMonth(Date d) {
          Calendar cal = Calendar.getInstance();
          cal.setTime(d);                
          cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DATE));
          cal.set(Calendar.HOUR_OF_DAY, 23);
          cal.set(Calendar.MINUTE, 59);
          cal.set(Calendar.SECOND, 59);
          cal.set(Calendar.MILLISECOND, 999);
          return cal.getTime();
      }
docs: Get last date from current month
  @param d date
  @return last date from current month