Log 2635
24/01/2024 2024-01-24 21:13$openingDate = #תאריך פתיחה#; // Replace with the actual opening date
// Split the opening date into day, month, and year
$dateParts = explode(‘/’, $openingDate);
$day = intval($dateParts[0]);
$month = intval($dateParts[1]);
$year = intval($dateParts[2]);
// Add 31 days to the opening date
$newDay = $day + 31;
// Check if the new day exceeds the maximum number of days in a month
if ($newDay > 31) {
$newDay -= 31;
$month++;
// Check if the new month exceeds December (12)
if ($month > 12) {
$month -= 12;
$year++;
}
}
// Format the new date as dd/mm/yyyy
$newDate = sprintf(‘%02d/%02d/%04d’, $newDay, $month, $year);
return $newDate; // Output: The calculated date that is 31 days after #תאריך פתיחה#