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?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1PY93s2
via IFTTT

Aucun commentaire:

Enregistrer un commentaire