To check if age is not less than 13 years in javascript
<p>Can anyone please guide me through javascript function, which will fetch me year difference between current date and date entered by user</p>

<p>I have tried this, but it doesnot keep in count leap years</p>

<pre><code>var yearOld=2000
var dateOld=11
var mnthOld=1;
var currendDate=new Date(); // 9 - jan - 2013

var oldDate=new Date(yearOld,mnthOld-1,dateOld);

var timeDiff =currendDate-oldDate ;

var diffDays = timeDiff / (1000 * 3600 * 24 * 365); 
</code></pre>

<p>Result is coming 13.00789 something where it should come less than 13</p>

<p>Any help will be appreciated</p>
