JavaScript - Compare two timestamps
<p>i try to compare two timestamps like this:</p>

<pre><code>var nowDate = new Date();
var givenDate = new Date(parseInt(year), parseInt(month), parseInt(day), parseInt(hour), parseInt(minute), 0);
var nd_timestamp = nowDate.getTime();
var gd_timestamp = givenDate.getTime();

if (nd_timestamp &gt; gd_timestamp) {
    alert("yes");   
}
</code></pre>

<p>But it is not working properly. If i look at the nd_timestamp and gd_timestamp everything looks fine, but the if-clause is not working. If i remove the parseInt(year)... and enter Date(2012, 04, 20, 0, 0, 0) the if-clause is working. </p>

<p>The variables year, month etc. comes through a function, but if i debug it with alert(year) etc. everything is fine. The given date through the form is smaller than the actual date.</p>

<p>Does anybody know why it is not working with variables?</p>

<p>Thanks!</p>
