日期:2014-05-16 浏览次数:20333 次
var now = new Date(); var pass = new Date('2010/04/16'); alert((now-pass)/1000/60/60/24+"天");
------解决方案--------------------
var now = new Date(); var pass = new Date('2010/04/16'); var num = parseInt((now-pass)/1000/60/60/24) alert(num+"天");
------解决方案--------------------
var now = new Date(); var pass = new Date('2010/04/16'); var num = parseInt((now-pass)/1000/60/60/24) alert(num+"天");
------解决方案--------------------
<script> var d1=new Date("2010/04/16 16:04:07"); var d2=new Date(); alert(parseInt((d2-d1)/(60*60*24*1000))); </script>