Keys →
Functions ↓
function roshHashanah ($y) { #-k DST holiday#- Determine Rosh Hashanah#- cannot be Sun, Wed or Fri; 163 days after 1st day of Passover. $y *= 1; # force to int to remove trim $G = rem($y,19) + 1; # Golden number $N = floor($y/100) - floor($y/400) - 2 + 765433/492480*rem(12*$G,19) + rem($y,4)/4 - (313*$y+89081)/98496; $F = $N - floor($N); $N = floor($N); $rh = strtotime ( '1 September ' . $y ); $rh = strtotime ( '+' . $N-1 . ' days', $rh ); $DoW = date ( 'N', $rh ); # 1-Mon, 2-Tue ... 7-Sun# postponement rules $add = 0; if (($DoW == 3) || ($DoW == 5) || ($DoW == 7)) { $add = 1; } if (($DoW == 1) && ($F >= (23269/25920)) && (rem(12*$G,19)>11)) { $add = 1; } if (($DoW == 2) && ($F >= (1367/2160)) && (rem(12*$G,19)>6)) { $add = 2; } if ($add > 0) { $rh = strtotime ( '+' . $add . ' days', $rh ); } return $rh; # begins at sundown of the previous day }?>