title: CakePHP: How to change default value of Date input
body: <p>I am trying to make a date input that defaults to the value that is already in the database.</p>
  
  <p>However, when I set the month, year, and date to the database values, the month, date, and year attributes are set on the select element but the page still displays the current date as the default values. When the form is submitted, today's date is stored in the database.</p>
  
  <p>Heres the code:</p>
  
  <pre><code>$mail_date_time = \explode(" ",$campaign["MailedDate"]);
  $mail_date = explode("-",$mail_date_time[0]);
  
  echo $this-&gt;Form-&gt;create("Campaign");
      echo $this-&gt;Form-&gt;input("MailedDate",array(
  
          'month' =&gt;strtotime($mail_date[1]), 
          'year' =&gt; strtotime($mail_date[0]), 
          'day' =&gt; strtotime($mail_date[2])
      ));
  
  echo $this-&gt;Form-&gt;end("Submit");
  </code></pre>
  
  <blockquote>
    <p>$mailed_date turns out to be: [0]=2009 [1]=11 [2]=11</p>
  </blockquote>
  
  <p>Does anyone know how to solve this?
  Thanks!</p>