$time_ago_op = time() - $comments[$c]['bcttime'];
if ($time_ago_op <= 60) { $comments[$c]['time_ago'] = $time_ago_op . " secs ago."; }
if ($time_ago_op >= 61 && $time_ago_op <= (60 * 60)) { $comments[$c]['time_ago'] = CleanNumber($time_ago_op / 60) . " mins ago."; }
if ($time_ago_op >= (1+(60 * 60)) && $time_ago_op <= (60 * 60 * 24)) { $comments[$c]['time_ago'] = CleanNumber($time_ago_op / (60 * 60)) . " hours ago."; }
if ($time_ago_op >= (1+(60 * 60 * 24)) && $time_ago_op <= (60 * 60 * 24 * 7)) { $comments[$c]['time_ago'] = CleanNumber($time_ago_op / (60 * 60 * 7)) . " days ago."; }
unset($time_ago_op);
用户发布后,它会以秒到分钟和小时为单位保持正确的时间,一旦达到 24 小时,时间就会加快。例如,一个 28 小时前的帖子说 3 天前等等......我试图弄清楚如何让它保持正确的时间,但我没有任何运气......如果有人可以帮助并指出什么我设置错了它会有很大帮助。谢谢