Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cwjcc!hal!ncoast!allbery From: ns@pr1me.dk.UUCP ( Sales Support) Newsgroups: comp.sources.misc Subject: v04i123: Calculate Eastern for given year Keywords: calendar, month Message-ID: <704@pr1me.dk> Date: 14 Oct 88 23:33:30 GMT Sender: allbery@ncoast.UUCP Reply-To: ns@pr1me.dk.UUCP ( Sales Support) Organization: Prime Computer A/S, Copenhagen, Denmark Lines: 62 Approved: allbery@ncoast.UUCP Posting-number: Volume 4, Issue 123 Submitted-by: " Sales Support" Archive-name: paaske I'm using the month-program for my appointments written by Origional Author: Tom Stoehn@Tektronics[zeus!tims] Modifications by: Marc Ries@TRW[trwrb!ries] Niels S|ndergaard, Prime Denmark (made Danish version) in addition to translateting to danish I also found reason to put in calculation of hollydays, in order to calculate the hollydays you need to find out what date Eastern sunday is, I found an algoritm in a book which Title I forgot by an author which name I also forgot, but I don't think there is any Copyrigth left as the book was from 1754. I coded and tested this routine from 1754 to 2037 (where I could verify the results) and found the algoritm correct. /* Udregn Paaske S|ndag for givent aar */ /* Calculate Eastern Sunday for given year */ /* Copyrigth (c) 1988, Prime Computer Inc. Mass. this program can be copied, distributed and used to any purpose. Prime Computer Inc, has no warrenty for any kind of damage done by using this program or the results from it */ int day,month; int paaske(year) int year; { int register b; int a,c,d,e,f,g,h,i,j,k,l,m,n,p,x; a= year%19; b=year/100; c=year%100; d=b/4; e=b%4; f = (b + 8)/25; g = (b - f + 1)/3; h = ((19 * a) + b - d - g + 15)%30; i = c/4; k = c%4; l = ((2*e) + (2*i) + 32 - h -k)%7; m = (a + (11*h) + (22*l))/451; x= (h + l - (7*m) + 114); n = x/31; p = x%31; day = p + 1; month= n; } -- Med Venlig Hilsen (With Kind Regards) Niels S|ndergaard, Prime Computer A/S, Denmark. ns@pr1me.dk, {...}!mcvax!dkuug!pr1me!ns or ns@cph-d.Prime.COM -- Med Venlig Hilsen (With Kind Regards) Niels S|ndergaard, Prime Computer A/S, Denmark. ns@pr1me.dk, {...}!mcvax!dkuug!pr1me!ns or ns@cph-d.Prime.COM