wonderring if anyone knows of a script to figure out when easter falls ... i've been trying to write a script for awhile that figures out if today is easter and writes a little "happy easter" message. actually the script is for all holidays, but easter is the toughest of them. most holidays fall on specific days like march 17 is always st.patty's day. easter is a wierd one.
thanx for any feedback ...
easter in php ...
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
here's how to figure it out: http://aa.usno.navy.mil/faq/docs/easter.html
so you just have to figure out when the full moon is after the vernal equinox. Simple enough
so you just have to figure out when the full moon is after the vernal equinox. Simple enough
Code: Select all
c = y / 100
n = y - 19 * ( y / 19 )
k = ( c - 17 ) / 25
i = c - c / 4 - ( c - k ) / 3 + 19 * n + 15
i = i - 30 * ( i / 30 )
i = i - ( i / 28 ) * ( 1 - ( i / 28 ) * ( 29 / ( i + 1 ) ) * ( ( 21 - n ) / 11 ) )
j = y + y / 4 + i + 2 - c + c / 4
j = j - 7 * ( j / 7 )
l = i - j
m = 3 + ( l + 40 ) / 44
d = l + 28 - 31 * ( m / 4 )they say that "y" is the year, "m" is the month, and "d" is the day. do you have any idea what the other variables represent or are they just temporary letters. i want to give them more "friendly" variable names so they don't get confused with other variables.
thanks.