title: Percentage of a date interval in Javascript
body: <p>Via javascript, I want to generate the percentage complete between these two days based on today and I will use this percentage on a jQuery UI progress bar to indicate the time complete or left.</p>
  
  <p>I have tried this formula but I end up always getting 100:</p>
  
  <p>Assume I have two dates:</p>
  
  <pre><code>start = new Date(2012,6,2); // Jul 02 2012
  end = new Date(2012,6,8); // Jul 08 2012
  today = new Date();
  
  alert( Math.round(100-((end - start) * 100 ) / today) + '%' );
  </code></pre>
  
  <p>How can I achieve this correctly?</p>