Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

date diff in laravel

$fdate = $request->Fdate;
$tdate = $request->Tdate;
$datetime1 = new DateTime($fdate);
$datetime2 = new DateTime($tdate);
$interval = $datetime1->diff($datetime2);
$days = $interval->format('%a');//now do whatever you like with $days
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #date #diff #laravel
ADD COMMENT
Topic
Name
8+3 =