什么是在Java中第二天获得特定时间的有效方法?假设明天03:30:00我需要很长时间.设置日历字段和日期格式是显而易见的.更好或更聪明的想法,感谢分享!
狼
我采取蛮力的方法
// make it now Calendar dateCal = Calendar.getInstance(); // make it tomorrow dateCal.add(Calendar.DAY_OF_YEAR, 1); // Now set it to the time you want dateCal.set(Calendar.HOUR_OF_DAY, hours); dateCal.set(Calendar.MINUTE, minutes); dateCal.set(Calendar.SECOND, seconds); dateCal.set(Calendar.MILLISECOND, 0); return dateCal.getTime();