月份增加 java

public void testsssf() throws ParseException {
		SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
		Date yourDate = sd.parse("2008-07-05");
		Calendar c = new GregorianCalendar();
		c.setTime(yourDate);
		System.out.println(sd.format(yourDate));
		c.add(Calendar.MONTH, 5);
		yourDate = c.getTime();
		System.out.println(sd.format(yourDate));
	}

你可能感兴趣的:(java,C++,c,C#)