Log 2181
07/11/2023 2023-11-07 14:51$taskDate = “10/12/2022”; // Replace with your task date
$currentDate = date(“d/m/Y”); // Get current date in day/month/year format
// Split the task and current dates into day, month, and year components
list($taskDay, $taskMonth, $taskYear) = explode(“/”, $taskDate);
list($currentDay, $currentMonth, $currentYear) = explode(“/”, $currentDate);
// Convert the day, month, and year components to integers
$taskDay = intval($taskDay);
$taskMonth = intval($taskMonth);
$taskYear = intval($taskYear);
$currentDay = intval($currentDay);
$currentMonth = intval($currentMonth);
$currentYear = intval($currentYear);
// Calculate the difference in days between the task date and current date
$daysDifference = ($currentYear – $taskYear) * 365 + ($currentMonth – $taskMonth) * 30 + ($currentDay – $taskDay);
return abs(floor($daysDifference)); // Echo the absolute value of the days difference as a whole number (without decimal)