$myTime = "1311059513";
$now = time();
$timeDiff = ($now - $myTime)/60;
我正在尝试从$myTime
中减去$now
以获得差异并除以60以获得分钟差异。
出于某种原因,我不会在$timeDiff
中得到分钟。
答案 0 :(得分:1)
开:PHP 5.3.2-1ubuntu4.7 with Suhosin-Patch (cli) (built: Jan 12 2011 18:36:55)
我明白了:
$myTime = "1311059513";
$now = time();
$timeDiff = ($now - $myTime)/60;
echo $timeDiff; // 443.78333333333
有什么问题?
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...