to see if it's the format string which is parsed in correctly or if it's the DateTime
object which is breaking stuff. From the testing it appears DateTime is broken somehow.
*/
-$ss = 'first day of last month midnight';
-$es = 'first day of this month midnight - 1 second';
+$ss = 'first day of March midnight';
+$es = 'first day of April midnight - 1 second';
$s = new DateTime($ss);
$e = new DateTime($es);
it just means you have to be careful of how we work with DateTimes .
*/
$s = new DateTime($ss);
-$e = new DateTime('first day of this month midnight');
+$e = new DateTime('first day of April midnight');
$e->modify('- 1 second');
var_dump($e->diff($s)->days); // 30 ... and should be 30
?>