I need to calculate an elapsed time between two date objects
<p>I have a date object created from vars saved in a database.</p>

<pre><code>var prevTime = Date(year,month,day,hour,minute);
</code></pre>

<p>I want to calculate the difference between this and the current time.</p>

<pre><code>var thisTime = Date();
</code></pre>

<p>I am doing this:</p>

<pre><code>prevTime.getTime() - thisTime.getTime();
</code></pre>

<p>It gives me a negative number that is very large.  I divide by 1000 to get seconds and then divide by 3600 to get hours.  I need an elapsed time in hours.  I end up with a number that is like -756.00.  If the current time is larger than the previous time, why is the number negative?  What am I doing wrong?</p>

<p>Thanks,</p>

<p>Scott</p>
