Just stumbled upon this weird bug with php's DateTime object... Check this out:
<?php
$date = 1335823200;
echo date('d',$date);
echo '<br />';
$date = new DateTime("@$date");
echo $date->format('d');
?>
Returns:
06
05
It doesn't happen with any timestamp. I suspect that it has something to do with different timezones, but playing around with setlocale() didn't help anything. By the way, the '@' in the DateTime is needed to be able to use unix timestamps (see bug report here). Here a few more timestamps to test:
1333663200
1338588000
1338847200