📜  php 以小时为单位的时差 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:47.549000             🧑  作者: Mango

代码示例4
$currentTime = (new DateTime('01:00'))->modify('+1 day');
$startTime = new DateTime('22:00');
$endTime = (new DateTime('07:00'))->modify('+1 day');

if ($currentTime >= $startTime && $currentTime <= $endTime) {
    // Do something
}