我有下面的 php 代码,使用 strtotime 将当前时间与当前时间进行了两次比较:
$timingsfirstTime[0] = date("H:i:s", strtotime(trim($showTimings[0])));
$timingslastTime[2] = date("H:i:s", strtotime(trim($showTimings[2])));
// 确认第一个节目的开始时间大于频道上最后一个节目的最后时间
$current_time = date("H:i:s",strtotime('now'));
$this->assertTrue(($current_time > $timingsfirstTime[0] && $current_time < $timingslastTime[2]),"current time ".$current_time. " is not greater than current show start time ". $timingsfirstTime[0] . " or current time is not less than current show end time ".$timingslastTime[2]);
但是我的断言以某种方式失败并输出:
当前时间 00:38:45 不大于当前演出开始时间 23:50:00 或当前时间不小于当前演出结束时间 00:50:00