<html>
<script type="text/javascript">
function getNextDay(d){
d = new Date(d);
d = +d + 1000*60*60*24*2;
d = new Date(d);
//return d;
//格式化
var day=0;
var month=0;
if((d.getMonth()+1)<10){
month="0"+(d.getMonth()+1);
}else{
month=d.getMonth()+1;
}
if(d.getDate()<10){
day="0"+(d.getDate());
}else{
day=d.getDate();
}
alert(d.getFullYear()+"-"+month+"-"+day);
return d.getFullYear()+"-"+month+"-"+day;
}
</script>
<body>
<input type="button" onclick="getNextDay('2014-10-31')"/>
</body>
</html>