title: How I can convert date object into time in symfony2
body: <p>I am using Symfony2. While fetching date from database, I need to display date in my <code>index.html.php</code> .</p>
  
  <p>When I am printing its displaying like this: <code>DateTime Object ( [date] =&gt; 2012-10-09 13:30:23 [timezone_type] =&gt; 3 [timezone] =&gt; UTC )</code></p>
  
  <p>But when I'm converting object to int its giving error: <code>$days2 = floor( $entities-&gt;getCreationDate() / (60 * 60 * 24));</code></p>
  
  <pre><code>Notice: Object of class DateTime could not be converted to int**
  </code></pre>