Date date = new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(day);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0); //设置时分秒都为0
day = cal.getTime();//day为2008-08-03 00:00:00
cal.add(Calendar.DAY_OF_YEAR, 1); //小时加1
Date d2 = cal.getTime(); //d2为2008-08-04 00:00:00
Calendar cal = Calendar.getInstance();
cal.setTime(day);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0); //设置时分秒都为0
day = cal.getTime();//day为2008-08-03 00:00:00
cal.add(Calendar.DAY_OF_YEAR, 1); //小时加1
Date d2 = cal.getTime(); //d2为2008-08-04 00:00:00