我为上次我没有正确提问而道歉。这是我在stackflow中提出的第一个问题。请帮助我以时间格式添加$interval1和interval2 ..我花了一整天的时间来尝试这个。谢谢你..
public function calculate_time_lap() {
$formate = "%h:%i";
$time1 = $this->input->post('time1');
$time2 = $this->input->post('time2');
$time3 = $this->input->post('time3');
$time4 = $this->input->post('time4');
$datetime1 = date_create($time1);
$datetime2 = date_create($time2);
$datetime3 = date_create($time3);
$datetime4 = date_create($time4);
$interval1 = date_diff ( $datetime2, $ datetime1);
$interval2 = date_diff( $datetime4, $datetime3);
add// ( $interval=($interval1,$interval2));
echo $interval->format($formate);
}