$clock_in = Carbon::createFromFormat('g:i A', Input::get('clock_in'))->timezone('UTC');
$clock_out = Carbon::createFromFormat('g:i A', Input::get('clock_out'))->timezone('UTC');
$attendance->clock_in = $clock_in->format('H:i:s');
$attendance->clock_out = $clock_out->format('H:i:s');
In this code I have clockIn and clockOut which get current time. Now, I want to subtract 5 hour :30 min from both i.e. clockIn and clockout. So, How can I do this? Please help me.
Thank You
5 hr 30 minis equals to5*3600+30*60 seconds,So you can use
subSecondslook like this:Or you can use
subMinutes: