我希望从当前Times计算的给定时间与UNIX格式之间得到时间差。
我的代码没有给我正确答案。
我的PHP代码:
$my_time = 1407410382;
$time_diff = strtotime(strftime("%F") . ' ' .$my_time) - time();
答案 0 :(得分:0)
尝试:
$then = 1407410382;
//Get the current timestamp.
$now = time();
//Calculate the difference.
$difference = $now - $then;
//Convert seconds into minutes.
$minutes = floor($difference / 60);
echo $minutes;