I have just come across this in my code for a live app where the system incorrectly regarded today and tomorrow as today. We have just gone into British Summer Time and this has caused a problem with our app.
I am now using the following, which is giving me the correct result:
function days_away_to($dt) {
$mkt_diff = strtotime($dt) - time();
return floor( $mkt_diff/60/60/24 ) + 1; # 0 = today, -1 = yesterday, 1 = tomorrow
}
Of course, using the DateTime class is the best solution going forward ...