我有一个时间戳,想向我的用户显示...上次发送时间是 1 天 23 小时 54 分 33 秒前。我知道如何获得时间差异...
$timePast = '2012-08-18 22:11:33';
$timeNow = date('Y-m-d H:i:s');
// gives total seconds difference
$timeDiff = strtotime($timeNow) - strtotime($timePast);
现在我被卡住了,无法像上面那样显示时间。x 天,x 小时,x 分钟,x 秒,其中所有 x 的总和应为总秒时差。我知道以下...
$lastSent['h'] = round($timeDiff / 3600);
$lastSent['m'] = round($timeDiff / 60);
$lastSent['s'] = $timeDiff;
需要你帮忙!提前致谢。