How to calculate total hours from time using laravel ?

I want to calculate total hours from number of rows.

Starter Asked on January 13, 2018 in Laravel.
Add Comment
1 Answer(s)

Please use below query i hope your problem is solve using the query,

 $totalHours = WorkDetails::selectRaw('time(sum(TIMEDIFF( workSession2EndTime, workSession1StartTime ))) as total')->get();
 

 

It’s working in my codes.

 

Starter Answered on January 13, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.