If the answer you expect is 15:50:00
and you want to use strtotime
and date
functions, you need to subtract the seconds $time1
and $time2
share when you transform them to unix timestamps:
$time1 = '15:20:00';
$time2 = '00:30:00';
$time = strtotime($time1) + strtotime($time2) - strtotime('00:00:00');
$time = date('H:i:s', $time);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…