title: Using DateTime::CreateFromFormat to create a date object
body: <p>I have a string of a date:</p>
  
  <pre><code>25/08/2012
  </code></pre>
  
  <p>And here I'm trying to convert it to a DateTime object in order to save it to the MySQL database. My backend schema has a <code>DateOfPrint date</code> column ready to receive this data.</p>
  
  <p>Here's what I've tried:</p>
  
  <pre><code>$eventDate = DateTime::createFromFormat('d/m/y', $fecha-&gt;innertext);
  echo $eventDate;
  </code></pre>
  
  <p>The <code>echo</code> statement doesn't show anything on the screen, and when trying to save it to the database, nothing is saved in that column.</p>
  
  <p>Any suggestions?</p>