JS 兩個字串時間的天數差 複製程式碼 程式碼如下: var s = ((new Date(paramObj.end_date.replace(/-/g,"/"))) - (new Date(paramObj.start_date.replace(/-/g,"/")))); var day = s/1000/60/60/24