title: Convert PHP date into javascript date format
body: <p>I have a PHP script that outputs an array of data.  This is then transformed into <code>JSON</code> using the <code>json_encode()</code> function.  </p>
  
  <p><strong>My issue is I have a date within my array and it's not in the correct JavaScript format.  How can I convert this within PHP so it is?</strong></p>
  
  <pre><code>$newticket['ThreadID'] =  $addticket;
  $newticket['Subject'] =  $subject;
  //$newticket['DateCreated'] =  date('d-m-Y G:H');
  </code></pre>
  
  <p>Instead of the above for the date I need the equivalent of the JavaScript function  </p>
  
  <blockquote>
    <p>new Date()</p>
  </blockquote>
  
  <p>When I output the above I get the following "Fri Jun 01 2012 11:08:48 GMT+0100 (GMT Daylight Time)" However, If I format my PHP date to be the same, then JavaScript rejects it.  Confused...</p>
  
  <p>Can anyone help?</p>