如何将1小时添加到日期(';H';)


How to add 1 hour to date('H')

简单的问题,如何在中添加1小时

$time = date('H'); 

我看到了一些例子,但还没有设法使其与日期('H')一起工作

使用PHP strtotime:-

date("Y-m-d H:i:s", strtotime('+1 hours'));

这里我的建议是

$time = date('H'); 
echo $time+1;

试试这个:

echo date("H", strtotime('+1 hours'));