js中计算时间差值 (天数)
<script>
function check_date_diff(){ //检测日期的间隔时间
var checkArray= new Array() ;// 考核时间转化
var checkDate = "2005/06/10";
checkArray = checkDate.split("/");
checkDate = new Date(checkArray[0],checkArray[1],checkArray[2]);
var nowTime = new Date();// 当前时间
var the_year = nowTime.getYear();
var the_month = nowTime.getMonth() + 1;
var the_day = nowTime.getDate();
nowTime = new Date(the_year,the_month,the_day);
var thesecond = 24 * 60 * 60 *1000 ;
var diffTime = (nowTime - checkDate)/thesecond;
//alert("ssc "+diffTime/thesecond);
return diffTime;
}
</script>