I have the following problem
First here is my code:
$day_difference = 1;
while (strtotime('-' . $day_difference . ' day', time()) >= strtotime('2011-12-12 00:08:00')) {
#echo $day_difference;
$day_difference++;
}
$datediff = $day_difference;
This code should output 1 day not 2 days
What is wrong ?
If you’re running PHP 5.3, you should use the native
DateTimeAPI.