PHP Class DateInterval
has a property "days". According to the manual it returns
"Total number of days the interval spans. If this is unknown, days will be FALSE."
In my case the code:
$d = new DateInterval('P1Y');
echo $d->days;
returns -99999
and a code like this
$a = DateTime::createFromFormat("d.m.Y", "01.01.2010");
$b = DateTime::createFromFormat("d.m.Y", "03.01.2010");
$d = $b->diff($a);
echo $d->days;
returns 6015
Did I misunderstand something?
DateInterval is buggy on windows platform. See bug #51183. The official answer seems to be "use VC9 builds instead for now".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With