首页 > 其他 > 详细

计算当前月有几天

时间:2014-12-07 13:42:26      阅读:280      评论:0      收藏:0      [点我收藏+]
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>计算当前月有几天</title>
<script>
    var oDate=new Date();

    oDate.setMonth(oDate.getMonth()+1, 1);
    // 11-1下个月的月初
    oDate.setDate(0);
    // 10-31   上个月底 
    alert((oDate.getMonth()+1)+-+oDate.getDate());
</script>
</head>

<body>
</body>
</html>

 

计算当前月有几天

原文:http://www.cnblogs.com/heboliufengjie/p/4149300.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!