I am using the same code on my computer and on my server at hostgator. Here's the code:
<?php
$checkout = "2014/03/11";
$checkin = "2014/03/09";
$checkin = date('Y/m/d', strtotime($checkin));
$checkout = date('Y/m/d', strtotime($checkout));
echo $checkin."<br />";
echo $checkout."<br />";
$nights = (strtotime($checkout) - strtotime($checkin)) / (60 * 60 * 24);
echo $nights;
?>
But I am getting different result. On my computer it display the correct answer which is "2". But on my server it displays "1.95833333333".
Can anyone tell me what's wrong?
Update:
Here's the output of the above code:
2014/03/09
2014/03/11
1.95833333333