I want to sum the daily working hours of a user and i have the time for checkin and checkout in a time column
$sql=" SELECT User_id, date, min(time) AS checkedin, max(time) AS checkedout,( (TIME_TO_SEC(TIMEDIFF(max(time), min(time))) / 60) / 60) difference
FROM profile WHERE 1 GROUP BY User_id, date";
$previousdata = DB::select($sql);
I get this array from the sql query that i have used and i want to add the difference that i get for everyday for a month's data. not to worry abt the date format, i am from nepal and am using the nepali date.