javascript Date diffrent days equal miliseconds
<p><a href="http://jsfiddle.net/skowron_line/zPCBc/1/" rel="nofollow">http://jsfiddle.net/skowron_line/zPCBc/1/</a></p>

<pre><code>var d1 = '31.05.2012';
var d2 = '01.06.2012';

var s1 = d1.split('.');
var s2 = d2.split('.');

var nd1 = new Date(s1[2], s1[1], s1[0]);
var nd2 = new Date(s2[2], s2[1], s2[0]);

$('#a').html(s1 + ' - '+ s2 +' = '+ nd2.getTime() +' - '+ nd1.getTime());

$('#b').html(
nd1.getFullYear() +'-'+ nd1.getMonth() +'-'+ nd1.getDate() +'&lt;br /&gt;'+ nd2.getFullYear() +'-'+ nd2.getMonth() +'-'+ nd2.getDate()
);
</code></pre>

<p>​
Can someone explain my what is wrong with this code ??. Why <code>31.05.2012</code> i equal to <code>01.06.2012</code></p>
