You are viewing a single comment's thread. Return to all comments →
php solution
function dayOfProgrammer($year) { $system = match (true) { $year < 1918 => "julian", $year > 1918 => "gregorian", default => "transition", }; $isLeapYear = false; switch ($system) { case "julian": $isLeapYear = $year % 4 === 0; break; case "gregorian": $isLeapYear = $year % 400 === 0 || $year % 4 === 0 && $year % 100 !== 0; break; default: return "26.09.1918"; break; } if ($isLeapYear) { return "12.09.$year"; } else { return "13.09.$year"; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Day of the Programmer
You are viewing a single comment's thread. Return to all comments →
php solution