How to get "the day before a date" in javascript?
<p>These two stack overflow questions ask a similar question, but their solution doesn't seem to work for me:
<a href="http://stackoverflow.com/questions/5511323/javascript-yesterday">Javascript Yesterday</a>
<a href="http://stackoverflow.com/questions/5495815/javascript-code-for-showing-yesterdays-date-and-todays-date">Javascript code for showing yesterday&#39;s date and todays date</a></p>

<p>Given a date, I need the date of the prior day (the day before). Here's a fiddle with the solution suggested above, and a scenario that doesn't work for me:
<a href="http://jsfiddle.net/s3dHV/" rel="nofollow">http://jsfiddle.net/s3dHV/</a></p>

<pre><code>var date = new Date('04/28/2013 00:00:00');
var yesterday = new Date();
yesterday.setDate(date.getDate() - 1);
alert('If today is ' + date + ' then yesterday is ' + yesterday);
</code></pre>

<p>For me, that alerts </p>

<blockquote>
  <p>If today is Sun Apr 28 2013 00:00:00 GMT-0400 (Eastern Daylight Time)
  then yesterday is Monday May 27 2013 11:12:06 GMT-0400 (Eastern
  Daylight Time).</p>
</blockquote>

<p>Which is obviously incorrect. Why? </p>
