Log 2371

$currentDate = date(‘d/m/Y’);
$birthDate = #תאריך לידה#;

$currentDay = substr($currentDate, 0, 2);
$currentMonth = substr($currentDate, 3, 2);
$currentYear = substr($currentDate, 6);

$birthDay = substr($birthDate, 0, 2);
$birthMonth = substr($birthDate, 3, 2);
$birthYear = substr($birthDate, 6);

$totalMonths = (($currentYear – $birthYear) * 12) + ($currentMonth – $birthMonth);

if ($currentDay < $birthDay) {
$totalMonths–;
}

$totalYears = floor($totalMonths / 12);
$totalMonths %= 12;

return "Age: {$totalYears} years and {$totalMonths} months";

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