Getting Previous Date Using Javascript
<p>I want to get the before six months date using javascript. </p>

<p>I am using the following method.</p>

<pre><code>var curr = date.getTime(); // i will get current date in milli seconds
var prev_six_months_date = curr - (6* 30 * 24 * 60* 60*1000);
var d = new Date();
d.setTime(prev_six_months_date);
</code></pre>

<p>Is this the right way or any better way to get the last six months date.</p>

<p>If this get fixed I want to apply this logic to get previous dates like last 2  months and last 10 years etc.</p>

<p>If any body give the solution in jquery also very helpful to me.
Thanks in advance.</p>
