I used the following function,
function datediff() { var dat1 = document.getElementById(\'date1\').value; alert(dat1);//i get 2010-04-01 var dat2 = documen
To use this function/method,you need an instance of the class Date .
This method is always used in conjunction with a Date object.
See the code below :
var d = new Date(); d.getTime();
Link : http://www.w3schools.com/jsref/jsref_getTime.asp