@foreach ($liveAuction as $item) @php // Assuming you have two dates $now = \Carbon\Carbon::parse(\Carbon\Carbon::now()); $endDate = \Carbon\Carbon::parse($item->end_date . $item->end_time); $difference = $endDate->diffInSeconds($now); // To get how many days are left from the time difference in seconds $days = floor($difference / 86400); // To get how many hours are left after days have been substracted $hours = floor(($difference % 86400) / 3600); //To calculate how many minutes are left $minutes = floor(($difference % 3600) / 60); @endphp