why is js substring is behaving in this manner
<pre><code>   var str ="20110725";
var dd = str.substring(6);
var mm = str.substring(4,2);
var yyyy = str.substring(0,3);
alert(dd );//25
alert(mm);//11
alert(yyyy );//2011
</code></pre>

<p>instead of that iam expecting 25 as date 07 as month and 2011 as year .please correct me</p>
