已知今天日期,计算明天日期
import java.text.SimpleDateFormat;
import java.util.Date;
public class CalNextDate {
public static void main(String[] args) {
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("MMM. d, yyyy HH:mm:ss");
sdf.setTimeZone(java.util.TimeZone.getDefault());
System.out.println(sdf.format(getNextDate(date)));
}
private static Date getNextDate(Date date) {
long addTime = 1;
addTime *= 1;
addTime *= 24;
addTime *= 60;
addTime *= 60;
addTime *= 1000;
Date d = new Date(date.getTime() + addTime);
return d;
}
}