I am running php 5.3.5 on my local wamp setup. I am running a simple code.
echo "<br/>DEBUGGING";
echo "<br/>===========";
echo "<br/>Date: ".$date;
echo "<br/>Lead Days: ".$lead_days;
echo "<br/>Date diff: ".var_dump(date_diff((int)$date, (int)$lead_days))." difference";
But the output is:
DEBUGGING
===========
Date: 2012-08-31
Lead Days: 2012-09-05
boolean false
Date diff: difference
date_diff seems to return false. I have tried it without var_dump and without int casting, but it always comes blank, however it works if I upload to my webserver. Any ideas what is wrong here?
You can’t case date string to int.
date_diffneed twoDateTimeobjects as parameter, and return aDateIntervalobject.