如何在没有秒的情况下比较两个时间戳


How to compare two timestamps without seconds?

>我有两个时间戳:一个来自time()函数,另一个在前端选择用户。我需要比较这两个时间戳,但忽略秒数或将其设置为 00。正确的方法是什么?

有时间举个例子:

$nr = 1111111122;
$nr = substr($nr, 0, strlen($nr)-2) . "00";

echo strtotime(date('Y-m-d H:i:00', time()));