当前时间加1 和 SimpleDateFormat
Calendar c = Calendar.getInstance();c.setTime(new Date()); //设置当前日期c.add(Calendar.DATE, 1); //日期加1Date date = c.getTime(); //结果
?
var d = new Date(new Date().getTime()+1000*60*60*24);
alert(d.getFullYear() + "年" + (d.getMonth()+1) + "月" + d.getDate() + "日");
?
附: SimpleDateFormat用法SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");String time = sdf.format(new Date());Date d = sdf.parse("2010-10-10 10:10:10");
http://download.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html