複製程式碼 程式碼如下:function getDays(strDateStart,strDateEnd){
var strSeparator = "-"; //日期分隔符號
var oDate1;
var oDate2;
var iDays
.split(strSeparator);
oDate2= strDateEnd.split(strSeparator);
var strDateS = new Date(oDate1[0], oDate1[1]-1, oDate1[2]);
strate1[1]-1, oDate1[2]);
strate = new Date(oDate2[0], oDate2[1]-1, oDate2[2]);
iDays = parseInt(Math.abs(strDateS - strDateE ) / 1000 / 60 / 60 /24)/把的毫秒數轉換為天數
return iDays ;
}