vendredi 29 janvier 2016

Laravel Time Difference Sum

I have a basic table which captures all sign in and out of a member of staff.

I am using laravel for my back-end and im struggling how to get the total number of hours on site.

ID | in_time   | out_time | in_date    | out_date
1  | 21:22:49  | 21:46:05 | 2016-01-28 | 2016-01-28
2  | 08:12:12  | 14:12:01 | 2016-01-28 | 2016-01-28

See my query so far

$date1 = '2015-01-28';
$date2 = '2015-01-28';

$attendancehours = DB::table('staff_attendances')->whereBetween('in_date', array($date1, $date2))->where('id', $sID)
        ->get();

How would I output total hours on site for that daterange?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire