Log 2447

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

// Convert birth date string to timestamp
$birthTimestamp = strtotime($birthDate);

// Get current timestamp
$currentTimestamp = time();

// Calculate the difference in seconds between birth date and current date
$diffSeconds = $currentTimestamp – $birthTimestamp;

// Convert seconds to years
$years = floor($diffSeconds / (365 * 24 * 60 * 60));

// Convert remaining seconds to months
$remainingSeconds = $diffSeconds % (365 * 24 * 60 * 60);
$months = floor($remainingSeconds / (30 * 24 * 60 * 60));

// Echo the result
return “Number of years: ” . $years . “
“;
return “Number of months: ” . $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