You may use something like the strtotime()
function to add something to the current timestamp. $new_time = date("Y-m-d H:i:s", strtotime('+5 hours'))
.
If you need variables in the function, you must use double quotes then like strtotime("+{$hours} hours")
, however better you use strtotime(sprintf("+%d hours", $hours))
then.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…