PHP time function

use PHP to determine whether a time exceeds 6 hours compared with the current time

Php
Mar.06,2021

compare, S (seconds according to timestamp)

$now_time = time()
$old_time = time(timestamps) //timestamps 
if($now_time-(60*60*6) > $old_time){
    //6
}

$time_6hours_ago = strtotime('-6hour');  -sharp//6
$compare_time; //
if($time_6hours_ago > $compare_time){
    -sharp//6
}
Menu