PHP DateTime issue
I've run into something notable. For some reason when adding a dateinterval with only minutes set in it makes it add 67 years.
$wTime = new DateTime("2011-05-17 01:54:56 +0000");
echo $wTime->format("d/m/Y H:i:s\n");
$wTime->add(new DateInterval("P810M"));
echo $wTime->format("d/m/Y H:i:s");
The result is:
17/05/2011 01:54:56
17/11/2078 01:54:56
I can't see where I'm doing anything wrong. Is this a bug in the DateTime object, or is something off with my code? I've run into annoying bugs with it in the past. I am running the latest version of PHP (5.3.6) built from source on Mac OS X 10.6
Answer:
http://stackoverflow.com/questions/6039278/php-datetime-issue