title: JavaScript Date Object's month index begins with 0
body: <p>My goal is to convert a timestamp from MySQL into a JavaScript Date object in an efficient manner.  Here is my current snippet that converts the MySQL timestamp into a formatted date in PHP:</p>
  
  <pre><code>&lt;?php
  // formats timestamp into following format: 2009, 7, 30
  $date =  date("Y, n, j", strtotime($row["date"]));
  ?&gt;
  </code></pre>
  
  <p>I am then using this <code>$date</code> value for a chart using Google's charting API which requires JavaScript Date object:</p>
  
  <pre><code>data.setValue(&lt;?=$count;?&gt;, 0, new Date(&lt;?=$date;?&gt;));
  </code></pre>
  
  <p>The problem is that the JavaScript Date object begins the month index with 0 so the output is always 1 month <strong>in advance</strong>.  What is the most efficient way in dealing with this issue?</p>
  
  <p>Thanks in advance!</p>