如果有问题应该是时区问题
<?php
print(strtotime(date('Y-m-d 23:59:59')) - time());
?>
<?php
date_default_timezone_set('Asia/Shanghai'); // 设置时区为上海时间
$currentTime = time();
$endOfDay = strtotime(date('Y-m-d 23:59:59'));
$secondsUntilEndOfDay = $endOfDay - $currentTime;
echo $secondsUntilEndOfDay;
?>