zgqynx 发表于 2013-1-27 05:19:44

月份增加 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));}
页: [1]
查看完整版本: 月份增加 java