-------------------------------------------------- -------------
title>
hEAD>
Function btncount_click () {
S1 = "2002-1-10"
S2 = "2002-10-1"
Alert (datediff (s1, s2))
}
/ / Calculate the function of the day difference, universal
Function datediff (sdate1, sdate2) {// sdate1 and sdate2 are 2002-12-18 format
Var Adate, Odate1, Odate2, iDays
Adate = sdate1.split ("-")
Odate1 = new date (Adate [1] '-' adate [2] '-' adate [0]) // Convert to 12-18-2002 format
Adate = sdate2.split ("-")
Odate2 = new date (adore [1] '-' adate [2] '-' adate [0])
iDays = parseint (Math.abs (Odate1 - Odate2) / 1000/60/60) // converts the number of milliseconds of the difference to the number of days
Return iDays
}
script>
body>
html>