Log 2317

// Get the current date
$currentDate = date(“d/m/Y”);

// Get the given date of birth from the placeholder
$birthDate = #תאריך לידה#;

// Convert both dates to timestamps
$currentTimestamp = strtotime($currentDate);
$birthTimestamp = strtotime($birthDate);

// Calculate the difference in seconds between the two timestamps
$timeDiff = $currentTimestamp – $birthTimestamp;

// Convert seconds to years by dividing by the number of seconds in a year (365.25 days)
$age = floor($timeDiff / (60 * 60 * 24 * 365.25));

// Echo the calculated age
return “גיל: ” . $age;

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