我正在尝试计算两个日期之间的天数,但只是不断收到“NaN。我查看了其他帖子,但无法完全解决:-S
function checkdate() {
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
var datenow = (day + "/" + month + "/" + year)
var startdate = document.forms[0].datescopestart.value;
var sDate = new Date(Date.parse("startdate","dd/mm/yy"));
var totaldays = Date.datenow - Date.sDate;
alert(totaldays);
}