title: Check if two PHP datetime objects are set to the same date ( ignoring time )
body: <p>I just want to compare 2 datetime objects to see if they are set to the same date, but I don't care about the time component of the the object.  At the moment I am using the date_format command to extract strings like 'Y-m-d' to compare but this seems awkward.</p>
  
  <pre><code>$firstDate = date_format($firstDateTimeObj, 'Y-m-d');
  $secondDate = date_format($secondDateTimeObj, 'Y-m-d');
  
  if !($firstDate == $secondDate) {
  
  // some code
  }
  </code></pre>
  
  <p>I'm new to programming and PHP so any pointers appreciated.</p>