title: Convert PHP and JSON encode to a Javascript Date
body: <p>All,
  I'm creating some JSON arrays by looping through my database and populating some values. The code to do this is:</p>
  
  <pre><code>$return_arr = array();
  $fetch = mysql_query("SELECT * FROM calendar_events"); 
  while ($row = mysql_fetch_array($fetch, MYSQL_ASSOC)) {
      $row_array['id'] = $row['id'];
      $row_array['title'] = $row['title'];
      $row_array['start'] = $row['start'];
      $row_array['end'] = $row['end'];
      $row_array['allDay'] = $row['allDay'];
      $row_array['description'] = $row['description'];
  
      array_push($return_arr,$row_array);
  }
  echo json_encode($return_arr);
  </code></pre>
  
  <p>This works fine except it doesn't display the date correctly. When I find examples of ones that have a date display correctly it looks like this:</p>
  
  <pre><code>{
      title: 'Birthday Party',
      start: new Date(y, m, d, 12, 0),
      end: new Date(y, m, d, 14, 0),
      allDay: false
  }
  </code></pre>
  
  <p>How can I use PHP to format my date like this so it looks the same. My data is stored as a DATETIME in the database. Any ideas would be greatly appreciated!</p>
  
  <p>Thanks!</p>