public static Long getMonthLastDate(date){
try{
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance();
if(!StringUtils.isEmpty(date)){
Date d = format.parse(date);
cal.setTime(d);
}
//核心代码
cal.set(Calendar.DAY_OF_MONTH,cal.getActualMaximum(Calendar.DAY_OF_MONTH));
String format1 = format.format(cal.getTime);
Long parse = format.parse(format1).getTime();
return parse;
}catch(Exception e){
return null;
}
}