Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel subtract date

$start_time = CarbonCarbon::parse($request->input('start_time'));
$finish_time = CarbonCarbon::parse($request->input('finish_time'));

$price = $request->input('price');

$result = $start_time->diffInDays($finish_time, false);

if ($result < 0) {
  $price = $price * $result;
}
 
PREVIOUS NEXT
Tagged: #laravel #subtract #date
ADD COMMENT
Topic
Name
3+7 =