Having a look on the PHP documentation, the following two methods of the DateTime object would both seem to solve my problem:
DateTime
If you want to compare dates and not time, you could use this:
$d1->format("Y-m-d") == $d2->format("Y-m-d")