code: public static Integer getDayNumOfMonth(Date date) {
  
          if (date == null)
              return null;
  
          Calendar calendar = Calendar.getInstance();
          calendar.setTime(date);
  
          return calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
      }
docs: 获取月的天数
  @param date 时间({@link Date})
  @return 月天数，如果date is null，将返回null