...

View Full Version : Finding Date difference between two dates



deepakmittal6_b
12-21-2005, 05:53 AM
How to compare two dates in Java script.
I need to find the difference between two dates.
Although i have found a method on this site but I am not sure about this whether it is right or not.
Because this logic fails for some values.

sysdate= Date.parse(date2,month2,year2);
entereddate= Date.parse(date1,month1,year1);
defauldate=Date.parse(defaultdate);

alert(sysdate);
alert(entereddate);
alert(defauldate);
alert((sysdate-entereddate)/(24*60*60*1000));
alert((entereddate-defauldate)/(24*60*60*1000));

Please reply back in anyone finds the answer.

Regards,
Deepak

Philip M
12-21-2005, 08:21 AM
You will find the solution at
http://www.codingforums.com/showthread.php?t=121



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum