Use the Date object like so:
function DateDiff(var /*Date*/ date1, var /*Date*/ date2) {
return date1.getTime() - date2.getTime();
}
This will return the number of milliseconds difference between the two dates. Converting it to seconds, minutes, hours etc. shouldn't be too difficult.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…