java 求几个月后的日期

Date plandate = planDate.toDate();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance();
cal.setTime(plandate);
// 取得三个月后时间
cal.add(Calendar.MONTH, 3);
planDate = UFDate.getDate(df.format(cal.getTime()));

 

你可能感兴趣的:(calendar,getinstance)