2009
09.16
09.16
In actionscript , algorithm , as3 | Tags:
Well it will be short - for Gregorian calendar it will be:
public static function resolveEasterDate(year:Number):Date { var a:Number, b:Number, c:Number, d:Number, e:Number, f:Number, g:Number, h:Number, i:Number, k:Number, l:Number, m:Number, p:Number; a = year % 19; b = int(year / 100); c = year % 100; d = int(b / 4); e = b % 4; f = int((b+8)/25); g = int((b-f+1)/3); h = (19*a+b-d-g+15) % 30; i = int(c / 4); k = c % 4; l = (32+(2*e)+(2*i)-h-k) % 7; m = int((a+(11*h)+(22*l))/451); p = (h+l-(7*m)+114) % 31; return new Date(year,int((h+l-(7*m)+114)/31)-1, p+1 ); }
3 ResponsesLeave a comment ?
really loved the article added to my favourites
Hello from Russia!
Can I quote a post in your blog with the link to you?
Hey, thanks very much for posting this. My website lets anyone create and edit events and timelines and I’ll use this code for making an Easter event. It will create a valid Easter event based on the timescale of the timeline.
Jennifer