日期:2014-05-17 浏览次数:20819 次
Calendar calendar = Calendar.getInstance();
DateFormat dateFormat=null;
dateFormat=new SimpleDateFormat("yyyy-MM-dd hh:mm");
Date date=dateFormat.parse("2013-12-07 10:23");
calendar.setTime(date);
calendar.add(Calendar.DATE, 1);
System.out.println(dateFormat.format(calendar.getTime()));
DateFormat dd=new SimpleDateFormat("yyyy-MM-dd hh:mm");
Date date=null;
try {
date = dd.parse("1990-10-10 10:00");
System.out.println(date);
long timeTenDaysLater = date.getTime() + 1000l*60*60*24*10;
System.out.println(new Date(timeTenDaysLater));
} catch (ParseException e) {
e.printStackTrace();
}
Calendar calendar = Calendar.getInstance();
DateFormat dateFormat=null;
dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm");
Date date=dateFormat.parse("2013-12-07 10:23");
calendar.setTime(date);
calendar.add(Calendar.HOUR,