1
I’m wondering how I could accomplish the sum (time format) of the records that were returned in the query.
I’m picking up the office hours considering that above 08:01 it’s delayed through there calculating how many minutes late the employee is...
if ($GetEntrada >= '08:01:00') {
$horaEntrada = '08:01:30';
$entrada = $tMC['Hora_Entrada'];
$total = (strtotime($entrada) - strtotime($horaEntrada));
$hora = floor($total / 60 / 60);
$minutos = round(($total - ($hora * 60 * 60)) / 60);
$hora = str_pad($hora, 2, "0", STR_PAD_LEFT);
$minutos = str_pad($minutos, 2, "0", STR_PAD_LEFT);
$atraso = $hora.':'.$minutos;
} else {
$atraso = "00:00";
}
echo "
<tr>
<td>$DataN[2]/$DataN[1]/$DataN[0]</td>
<td>$atraso</td>
<td>{$tMC['Hora_Entrada']}</td>
<td>{$tMC['Hora_InicioIntervalo']}</td>
<td>{$tMC['Hora_FimIntervalo']}</td>
<td>{$tMC['Hora_Saida']}</td>
</tr>
";
I would like to calculate all the values of "<td>$atraso</td>"
as shown in the attachment below and display in time format.
Which php version is using?
– teliz
I am using Version 5.6, if necessary I can update quickly...
– Benhur Da Silveira Kulzer
If necessary
– Benhur Da Silveira Kulzer
Hello Friend Anderson, This you quoted explains about the difference between two dates, my question is a little different, As I would do to sum up all the delays to be able to define the total of Hours late (Whole month) of the values contained in the "<td>$delay</td>"
– Benhur Da Silveira Kulzer
I got the solution for what I needed in this topic pt.stackoverflow.com/questions/215123/... , I apologize if I ended up expressing myself badly or unable to explain well, thank you very much
– Benhur Da Silveira Kulzer