public static void main(String[] args) {
Date now=new Date();
System.out.println(getNextDate(now));
}
private static String getNextDate(Date d) {
long addTime = 1;//用1为乘的基数
addTime *= 1;
addTime *=24; //1天24小时
addTime *=60; //一小时60分钟
addTime *=60; //一分钟60秒
addTime *=1000; //一秒1000毫秒
Date date=new Date(d.getTime()+addTime);
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(date);
Date now=new Date();
System.out.println(getNextDate(now));
}
private static String getNextDate(Date d) {
long addTime = 1;//用1为乘的基数
addTime *= 1;
addTime *=24; //1天24小时
addTime *=60; //一小时60分钟
addTime *=60; //一分钟60秒
addTime *=1000; //一秒1000毫秒
Date date=new Date(d.getTime()+addTime);
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(date);