Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/278.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何提前1小时到达_Php - Fatal编程技术网

Php 如何提前1小时到达

Php 如何提前1小时到达,php,Php,如何在php中提前1小时获取 我尝试: 但不起作用 $jam = "10:00:00"; $1hrsbefore = strtotime($jam), strtotime(-1 hours); 请尝试以下代码: $jam = "10:00:00"; $timeadd= strtotime($jam) - 60*60; $time = date('H:i:s', $timeadd); echo $time; 试试这个 $jam="10:00:00"; $time = date('H:i:s',

如何在php中提前1小时获取
我尝试:
但不起作用

$jam = "10:00:00";
$1hrsbefore = strtotime($jam), strtotime(-1 hours);
请尝试以下代码:

$jam = "10:00:00";
$timeadd= strtotime($jam) - 60*60;
$time = date('H:i:s', $timeadd);
echo $time;

试试这个

$jam="10:00:00";
$time = date('H:i:s', strtotime($jam) - 60*60);
echo $time;

这回答了你的问题吗?另一个类似的例子,但“加1小时”:@Ajith他并没有要求从当前时间减去-1小时。试试这个
$oneHourBefore=date(“H:i:s”,strotime(“10:00:00”)-(60*60))