如何在PHP 24小时格式中扣除时间

How to subtract 00:00:00 example with 1 hour?

I've tried:

$minus1=strtotime(00:00:00)-strtotime('-1 hour');

but instead of an answer of 23:00:00, I got -1502671524 instead.

You can use DateTime and DateInterval option to do in PHP.

    $date = new DateTime('00:00:00');
    $date->sub(new DateInterval('PT1H00M'));
    echo $date->format('H:i:s') . "
";

The P stands for Period. The T stands for Timespan. H stands for Hour to reduce and finally M stands for Minutes to reduce.

See DateTime, DateTime::sub, and DateInterval in the PHP manual. You'll have to set the DateTime to the appropriate date and time, of course.