3d科技网
您的当前位置:首页Js时间间隔计算的函数(间隔天数)_时间日期

Js时间间隔计算的函数(间隔天数)_时间日期

来源:3d科技网


代码如下:
function GetDateDiff(startDate,endDate)
{
var startTime = new Date(Date.parse(startDate.replace(/-/g, "/"))).getTime();
var endTime = new Date(Date.parse(endDate.replace(/-/g, "/"))).getTime();
var dates = Math.abs((startTime - endTime))/(1000*60*60*24);
return dates;
}
显示全文