I need help, i have a while loop with dates for one month from mysql. i have calculated the difference between times. now i must sum that all differences at the end. i have tried a lot. is there any option to add all that differences without writing each day?
while($row = mysqli_fetch_assoc($sql)){ // <---- while loop makes round 30 times... 1 month long
$usern = $row['title'];
$arbeit = $row['description'];
$start_com = $row['start']; // <--- DATETIME
$end_com = $row['end']; // <----- DATETIME
$shop = $row['category'];
$time_from = strtotime( $start_com );
$time_from = date("H:i", $time_from);
$time_to = strtotime( $end_com );
$time_to = date("H:i", $time_to);
$dteStart = new DateTime($start_com);
$dteEnd = new DateTime($end_com);
$dteDiff = $dteStart->diff($dteEnd);
$e = MyDateInterval::fromDateInterval($dteDiff);
$e->add($dteDiff); // ----- this not works
echo '.$dteDiff->format("%H:%I").';
}
// echo $e->format("%H:%I:%S"); // ------- not working...
// <---- here i need sum of the datetimes diff ---->
$dteDiff must at the end the complete diff all times. Can anyone help me?