/**
* 得到几天后的时间
*
* @param d
* @param day
* @return
*/
public Date getDateAfter(Date d, int day) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar now = Calendar.getInstance();
now.setTime(d);
now.set(Calendar.DATE, now.get(Calendar.DATE) + day);//+后 -前
return now.getTime();
}
int y = now.get(Calendar.YEAR);
int m = now.get(Calendar.MONTH) + 1;
int s = now.get(Calendar.DATE);
获取月份需要+1,如果需要标准的格式如:2018-08-28 需要判断m和s是否小于10;做+0操作