Log 2181

$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)

Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
  • Attributes
  • Custom attributes
  • Custom fields
Click outside to hide the comparison bar
Compare