javascript中如何获得指定的时间+1天, 比如说当前时间是2012-06-30 , +1天后就是2012-07-01
1个回答
展开全部
<script>
function nextday(year, month, day)
{
var curday = new Date();
curday.setYear(year);
curday.setMonth(month-1);
curday.setDate(day + 1);
return curday.getFullYear()+"-"+(curday.getMonth()+1) + "-" + curday.getDate();
}
alert(nextday(2012,6,30));
</script>
满意请采纳!
function nextday(year, month, day)
{
var curday = new Date();
curday.setYear(year);
curday.setMonth(month-1);
curday.setDate(day + 1);
return curday.getFullYear()+"-"+(curday.getMonth()+1) + "-" + curday.getDate();
}
alert(nextday(2012,6,30));
</script>
满意请采纳!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询