function orthodox_easter()

Given a year, orthodox_easter calculates the timestamp of this year’s Orthodox Easter.


function orthodox_easter($year) {
/*
The Date of Orthodox Easter: An algorithm based on Oudin's Algorithm
Based on http://www.smart.net/~mmontes/ortheast.html#ALG

18-Oct-2003, Panayotis Vryonis <panayotis @ vrypan.net >

ex. usage: echo date ("l dS of F Y h:i:s A",orthodox_easter(2004) )
*/
$G = $year % 19 ;
$I = (19*$G + 15) % 30 ;
$J = ($year + floor($year/4) + $I) % 7 ;
$L = $I - $J ;
$EasterMonth = 3 + floor( ($L + 40)/44 );
$EasterDay = $L + 28 - 31*floor($EasterMonth/4) ;

if ($year<2100) $toGregorian=13 ;
else $toGregorian=14 ;

$ret = mktime(0,0,0,$EasterMonth,$EasterDay+$toGregorian,$year) ;
return $ret ;
}

— Uncategorized — Tags: — Panayotis @ 18|Oct|2003 05:11

0 Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2008 vrypan|net|weblog | powered by WordPress with Barecity