title: javascript date object issue in Safari and IE
body: <p>I am taking a date from a JSON object in the format of 2012-12-31 and trying to convert it into friendly values and output it.</p>
  
  <pre><code>    var redeemableDate = item.Deal.RedeemableDate; //this is coming in the form of 2012-12-31
      var redeemableDate = new Date(redeemableDate);
      var rdDay = weekday[redeemableDate.getDay()]; //using an array with weekdays
      var rdDate = redeemableDate.getDate();
      var rdMonth = monthNames[redeemableDate.getMonth()]; //using an array with month names
      var rdYear = redeemableDate.getFullYear();
  
      response.write('Valid ' + rdDay + ' ' + rdDate + ' ' + rdMonth + ' ' + rdYear + ' ONLY');
  </code></pre>
  
  <p>It all works find and dandy in Firefox and Chrome, but Safari and IE (only tested on IE8 so far) don't like it.</p>
  
  <p>In FF and Chrome I get the expected:</p>
  
  <blockquote>
    <p>Valid Sunday 2 September 2012 ONLY</p>
  </blockquote>
  
  <p>But in Safari and IE, I get:</p>
  
  <blockquote>
    <p>Valid undefined NaN undefined NaN ONLY</p>
  </blockquote>
  
  <p>When I alert redeemableDate after I have set it as a Date object, Safari returns 'Invalid Date' and IE returns 'NaN'. This is obviously where the issue lies. Is there a way I can get my value into a date object for these browsers?</p>