day1='2014-03-31 00:00:01';
function get_day(day1,day2){ var s = day1; var dt = Date.parse(s.replace(/-/g,"/")); var day1 = new Date(dt); var s = day2; var dt = Date.parse(s.replace(/-/g,"/")); var day2 = new Date(dt); var date3=day1.getTime()-day2.getTime() //时间差的毫秒数 //计算出相差天数 return Math.floor(date3/(24*3600*1000)) }
时间: 2024-10-15 08:28:28