PHP So sánh thời gian hơn 24h

Đoạn PHP So sánh thời gian hơn 24h

$start_date = '2021-07-09 01:24:41';

        $current_date = date('Y-m-d H:i:s');

        $timediff = strtotime($current_date) - strtotime($start_date);

        if($timediff > 86400){//Lon hon 24h

            echo 'more than 24 hours';

        }

Tin tức khác