实现方法:
public static String getNextDate(String sdf,String dateString) {
Calendar now_Time = Calendar.getInstance();
DateFormat df=new SimpleDateFormat(sdf);
try {
now_Time.setTime(df.parse(dateString));
} catch (ParseException e) {
// TODO 自动生成 catch 块
e.printStackTrace();
}
now_Time.add(Calendar.DATE,1);
SimpleDateFormat sdNowDate = new SimpleDateFormat(sdf);
return sdNowDate.format(now_Time.getTime());
}
TEST:
getNextDate("yyyy-MM-dd","2005-12-31")
RESULT:
2006-01-01