{{ \Carbon\Carbon::parse($salesmantarget->month_year)->format('F j, Y') }}
<?php
$OldDate = strtotime($salesmantarget->month_year);
$NewDate = date('M j, Y', $OldDate);
$diff = date_diff(date_create(date("M j, Y")),date_create($NewDate));
if($diff->format("%R%a days") > 0)
{
echo $diff->format("( %R%a days to go )");
}else{
echo "";
}
?>
Here, month_year is the column name which is a date field.
Comments
Post a Comment