Menu
Hi all
Using this code, I expect to see the $difference to be number 3 but it returns as 4 which is wrong:
[code=php]
$difference = strtotime(‘2010-04-01’) – strtotime(‘2010-04-03’);
echo $difference/(60*60*12);
If I use this however (note the second date is 2010-04-02)
[code=php]
$difference = strtotime(‘2010-04-01’) – strtotime(‘2010-04-02’);
echo $difference/(60*60*12);
$difference returns as 2 which is correct.
Why is this not working for the first calculation?
Thanks for helping
p.s. those who are wondering what I am trying to achieve, I just need to calculate the number of days difference between two dates!!