如何使下面的代码以小时为单位转换天数?
$timestart = date_create('02/11/2011' . $row->timestart); //$row->timestart returns time in 00:00:00 format
$timestop = date_create('02/11/2011' . $row->timestop); //$row->timestop returns time in 00:00:00 format
date_add($timestop, date_interval_create_from_date_string('2 days')); //add 2 days
$date_diff = date_diff($timestart, $timestop);
echo "Timespan: ";
echo $date_diff->format('%h hours');
echo "<br />";
我怎样才能得到hours:minutes:seconds
过去的?我正在尝试保留该date_diff
功能。