Javascript setDate Confusion
<p>I am trying to create a date object that is 90 days from a specified date for use in a date comparison, but am not getting the correct dates.  I have isolated my problem to the code shown below.</p>

<pre><code>var now = new Date();
var beforeNow = new Date();
var afterNow = new Date();
var myDate = new Date();
var beforeMyDate = new Date();
var afterMyDate = new Date();

beforeNow.setDate(now.getDate() - 90);
afterNow.setDate(now.getDate() + 90);

myDate.setFullYear(2011, 10, 22); // set to Nov 22, 2011

beforeMyDate.setDate(myDate.getDate() - 90); // set to 90 days before Nov 22, 2011
afterMyDate.setDate(myDate.getDate() + 90); // set to 90 days after Nov 22, 2011
</code></pre>

<p>The above is resulting in:</p>

<p><em>beforeMyDate</em>: Fri Dec 23 2011 08:46:18 GMT-0800 (Pacific Standard Time)</p>

<p><em>myDate</em>: Tue Nov 22 2011 08:46:18 GMT-0800 (Pacific Standard Time)</p>

<p><em>afterMyDate</em>: Wed Jun 20 2012 08:46:18 GMT-0700 (Pacific Daylight Time)</p>

<p>Here's a fiddle: <a href="http://jsfiddle.net/LnmpR/9/" rel="nofollow">http://jsfiddle.net/LnmpR/9/</a></p>

<p>Any help would be appreciated. Thanks.</p>
