title: Storing date values passed by AJAX call in CakePHP
body: <p>I'm trying to pass a javascript Date object to a controller that I have in CakePHP via an AJAX call. I had to convert the date object in js before sending it over, cause it wasn't being sent.</p>
  
  <pre><code>startDate = startDate.toUTCString();
  </code></pre>
  
  <p>What I get in the controller is a string</p>
  
  <blockquote>
    <p>Wed, 31 Jan 2001 14:01:01 GMT</p>
  </blockquote>
  
  <p>No problem so far. But now I need to store this value in database which uses a datetime field for this. I noticed Cake uses this array that represents the datetime.</p>
  
  <pre><code>[start_date] =&gt; Array
  (
      [month] =&gt; 06
      [day] =&gt; 20
      [year] =&gt; 2011
      [hour] =&gt; 02
      [min] =&gt; 19
      [meridian] =&gt; am
  )
  </code></pre>
  
  <p>How can I convert the string that I have earlier to this structure?</p>