title: Symfony2: How to operate with datetime-objects
body: <p>i can't really get it how to work with datetime-objects in symfony2. </p>
  
  <p>i have few games-entries in database which one has a datetime-property.
  and now i want to compare to the actual date: i want to have all records from the past 10 days. how can i achieve this?</p>
  
  <p>i tried this</p>
  
  <pre><code>date($game-&gt;getZeit(), mktime(0,0,0,date('m'),date('d'),date('y')))
  </code></pre>
  
  <p>to get a compareable date which i can compare with</p>
  
  <pre><code>date('Y.m.d H:i:s', mktime(0,0,0,date('m'),date('d'),date('y')));
  </code></pre>
  
  <p>but that didnt work because</p>
  
  <pre><code>$game-&gt;getZeit()
  </code></pre>
  
  <p>cannot be converted to a string. why? so how can i debug this one? how can i know its value? how can i compare it with other datetimes or date-strings?</p>
  
  <p>quick help would be really appreciated! :)</p>
  
  <p>kind regards</p>