我有这样的代码:的strtotime减去小时和分钟
<?php
$date = date('Y-m-d H:i:s', strtotime('-6 hours', (int)get_the_time('U')));
echo $date;
?>
,你可以看到的时间是从时间减去6小时改变,我想要什么减去小时,也分钟,所以我想这:
<?php
$date = date('Y-m-d H:i:s', strtotime('-6 hours', '-23 minutes', (int)get_the_time('U')));
echo $date;
?>
但是不工作,任何想法?
预先感谢您
[PHP,使用strtotime从日期时间变量中减去分钟数?]的可能重复(https://stackoverflow.com/questions/11688829/php-use-strtotime-to-subtract-minutes-from-日期时间变量) –
'strtotime'只接受2个参数,而不是3个。将小时和分钟放入同一个字符串。 – deceze