fix datetime equality test in php 5.3+