http://blog.csdn.net/zhengqiqiqinqin/article/details/20630415
比如现在有个String str =”2013-07-18”;
现在要在这个时间上加8个月就变成了“2014-03-18”
怎么完成这种时间的转换加减
String str = "2013-07-18";
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
try {
Date myDate = formatter.parse(str);
Calendar c = Calendar.getInstance();
c.setTime(myDate);
c.add(Calendar.MONTH, 8);
myDate = c.getTime();
System.out.println(formatter.format(myDate));
} catch (ParseException e1) {
e1.printStackTrace();
}