PHP Time Differences
$myTime = "1311059513";
$now = time();
$timeDiff 开发者_C百科= ($now - $myTime)/60;
I'm trying to subtract $myTime
from $now
to get the difference and divide by 60 to get the minutes difference.
For some reason I don't get minutes in $timeDiff
.
On: PHP 5.3.2-1ubuntu4.7 with Suhosin-Patch (cli) (built: Jan 12 2011 18:36:55)
I get:
$myTime = "1311059513";
$now = time();
$timeDiff = ($now - $myTime)/60;
echo $timeDiff; // 443.78333333333
What's the problem?
1311059513 corresponds to 2011-07-19T02:11:53-05:00
ran it at 2011-07-19T09:35:40-05:00
09:35:40 - 02:11:53 = 7hrs 23min 57s = 443min 57s = 443.7833...
精彩评论