JavaScript date comparison oddity
<p>I have an issue with JavaScript date comparison.  I create a Date object for 31st Oct, and another for 1st Nov, yet getTime() for each returns the same figure, and the greater-than / less-than operators also consider the dates equal.  Here is my code:</p>

<pre><code>d1 = new Date(2012, 10, 31, 0, 0, 0, 0);
d2 = new Date(2012, 11, 1, 0, 0, 0, 0);
document.write(d1.getTime() + "&lt;br /&gt;");
document.write(d2.getTime() + "&lt;br /&gt;");
document.write((d1 &lt; d2) + "&lt;br /&gt;");
document.write((d1 &gt; d2) + "&lt;br /&gt;");
</code></pre>

<p>And here is the output:</p>

<pre><code>1354320000000
1354320000000
false
false
</code></pre>

<p>The same code works fine around other month endings, it seems to be just these two dates that cause an issue.</p>

<p>Any help appreciated!</p>
