我有以下应该在比赛开始/开始之前要花费几天和几小时的时间
$time=$row['event_time'];
$gameDate = $row['event_date'];
if($gameDate !== $lastDate){
$calcDate= strtotime('Ymd',$gameDate,$time); //suspect problem is here
var_dump($calcDate);
$remaining = $calcDate - time();
$days_remaining = floor($remaining / 86400);
$hours_remaining = floor(($remaining % 86400) / 3600);
echo'
';$lastDate = $gameDate;
echo '
'.$gameDate.'';但是,当我在$calcDate上执行var_dump时,它只会返回布尔值false,false
我已经搜索,调整和尝试过,希望有更多经验的php用户可以在这里帮助我
假设日期和时间为2015-05-17 08:00
解决方法:
我认为那行应该是
$calcDate= strtotime($gameDate . " " . $time)
标签:html,php
来源: https://codeday.me/bug/20191028/1951561.html