日期:2014-05-17 浏览次数:20739 次
String dateStr1 = "2012-07-14 14:30:00"; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); java.util.Date d1 = null; try { d1 = sdf.parse(dateStr1); } catch (ParseException e1) { e1.printStackTrace(); } java.util.Date d2 = new Date(d1.getTime() + 100 * 60 * 60 * 1000); String dateStr2 = sdf.format(d2); System.out.println(dateStr2);
------解决方案--------------------
//currentDate加上一个小时后到日期
currentCalendar.setTime(currentDate);
currentCalendar.add(Calendar.HOUR_OF_DAY, 1);
Date addDateH = currentCalendar.getTime();
http://blog.csdn.net/robert_feng/article/details/6467207这个说的很详细,很好
------解决方案--------------------