How to get a difference between two dates?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/41948/how-do-i-get-the-difference-between-two-dates-in-javascript">How do I get the difference between two Dates in JavaScript?</a>  </p>
</blockquote>



<p>How to get the difference between two dates using javascript.I need the exact day difference between those two dates.Here is my code</p>

<pre><code>function calculateDifference() {
var startDate = document.getElementById("MainContent_txtOStartDate").value;
var endDate = document.getElementById("MainContent_txtOEndDate").value;
return DateDiff(startDate, endDate);
}

function DateDiff(startDate, endDate) {
var a = Date.parse(startDate) - Date.parse(endDate);
alert(a);
}
</code></pre>

<p>Any suggestion?</p>
