laravel subtract date

Solutions on MaxInterview for laravel subtract date by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
showing results for - "laravel subtract date"
Luca
02 May 2017
1$start_time = \Carbon\Carbon::parse($request->input('start_time'));
2$finish_time = \Carbon\Carbon::parse($request->input('finish_time'));
3
4$price = $request->input('price');
5
6$result = $start_time->diffInDays($finish_time, false);
7
8if ($result < 0) {
9  $price = $price * $result;
10}