标签:
1 /** 2 * getCycleEndTime 3 * @param startTime 起始时间 4 * @param planDays 天数 5 * @return 终止时间 6 * @time 2015-12-04 7 * @author ariclee 8 */ 9 public String getCycleEndTime(String startTime, int planDays) 10 { 11 SimpleDateFormat sFormat = new SimpleDateFormat("yyyy-MM-dd"); 12 Date date=null; 13 try { 14 date=sFormat.parse(startTime); 15 } catch (ParseException e) { 16 17 e.printStackTrace(); 18 } 19 Calendar calendar = Calendar.getInstance(); 20 calendar.setTime(date); 21 calendar.add(Calendar.DAY_OF_MONTH,planDays); 22 Date resultDate=calendar.getTime(); 23 String result=sFormat.format(resultDate); 24 25 return result; 26 }
标签:
原文地址:http://www.cnblogs.com/gossiplee/p/5077096.html