您可以使用类似
strtotime()函数之类的功能向当前时间戳添加内容。
$new_time= date("Y-m-d H:i:s", strtotime('+5 hours'))。如果在函数中需要变量,则必须使用双引号,然后使用like
strtotime("+{$hours}hours"),但是最好使用双引号strtotime(sprintf("+%d hours", $hours))。
您可以使用类似
strtotime()函数之类的功能向当前时间戳添加内容。
$new_time= date("Y-m-d H:i:s", strtotime('+5 hours'))。如果在函数中需要变量,则必须使用双引号,然后使用like
strtotime("+{$hours}hours"),但是最好使用双引号strtotime(sprintf("+%d hours", $hours))。