I am getting wrong Date difference between two dates using Carbon in Laravel 5.7.
here this image is showing you Date of sdate value and edate value
my code is
$date = Carbon::parse($sdate);
$now = Carbon::parse($eDate);
$diff = $date->diffInDays($now);
return ["sdate"=>$sdate,
"eDate"=>$eDate,
"total" => $diff,
"holidays" => $holidayDayCount,
"classes" => $diff - count($leaveDayArr),'sunday'=>$sundayArr ,'offDate'=>$offDay
];
After this I am getting in API response.
it is showing me 29 but it should be 30.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire