标签:
<script>
var sDate="2007-12-25";
var eDate="2008-01-02";
var sArr = sDate.split("-");
var eArr = eDate.split("-");
var sRDate = new Date(sArr[0], sArr[1], sArr[2]);
var eRDate = new Date(eArr[0], eArr[1], eArr[2]);
var day= (eRDate-sRDate)/(24*60*60*1000); // 天数
var month = parseInt(day/28);//月数,要考虑2月份
alert(day);
</script>
标签:
原文地址:http://www.cnblogs.com/yushouling/p/4891397.html