比如某个影片的上映时间是22:50:00,电影时间总长度是01:40:00 ,这样怎么计算出最后 的结束时间呢
$date = new DateTime('22:50:00');$date->add(new DateInterval('PT01H40M00S'));echo $date->format('H:i:s');只有版主这种方法吗 01:40:00这个需要转换下?
这样也行
echo date('H:i:s', strtotime('22:50:00') + strtotime('01:40:00') - strtotime('00:00:00'));Call to undefined method DateTime::add() 没这个方法呢
这样也行
echo date('H:i:s', strtotime('22:50:00') + strtotime('01:40:00') - strtotime('00:00:00')); DateTime::add
(PHP 5 >= 5.3.0)
DateTime::add
(PHP 5 >= 5.3.0)
这样也行
echo date('H:i:s', strtotime('22:50:00') + strtotime('01:40:00') - strtotime('00:00:00'));
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号