home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume4 / paaske < prev    next >
Encoding:
Internet Message Format  |  1989-02-03  |  2.2 KB

  1. Path: xanth!mcnc!gatech!rutgers!tut.cis.ohio-state.edu!cwjcc!hal!ncoast!allbery
  2. From: ns@pr1me.dk.UUCP ( Sales Support)
  3. Newsgroups: comp.sources.misc
  4. Subject: v04i123: Calculate Eastern for given year
  5. Keywords: calendar, month
  6. Message-ID: <704@pr1me.dk>
  7. Date: 14 Oct 88 23:33:30 GMT
  8. Sender: allbery@ncoast.UUCP
  9. Reply-To: ns@pr1me.dk.UUCP ( Sales Support)
  10. Organization: Prime Computer A/S, Copenhagen, Denmark
  11. Lines: 62
  12. Approved: allbery@ncoast.UUCP
  13.  
  14. Posting-number: Volume 4, Issue 123
  15. Submitted-by: " Sales Support" <ns@pr1me.dk.UUCP>
  16. Archive-name: paaske
  17.  
  18. I'm using the month-program for my appointments written by
  19.   Origional Author:    Tom Stoehn@Tektronics[zeus!tims]
  20.   Modifications by:    Marc Ries@TRW[trwrb!ries]
  21.             Niels S|ndergaard, Prime Denmark
  22.             (made Danish version)
  23.  
  24. in addition to translateting to danish I also found reason to put in
  25. calculation of hollydays, in order to calculate the hollydays you need
  26. to find out what date Eastern sunday is, I found an algoritm in a book
  27. which Title I forgot by an author which name I also forgot, but I
  28. don't think there is any Copyrigth left as the book was from 1754. I
  29. coded and tested this routine from 1754 to 2037 (where I could verify
  30. the results) and found the algoritm correct.
  31.  
  32. /* Udregn Paaske S|ndag for givent aar */
  33. /* Calculate Eastern Sunday for given year */
  34. /* Copyrigth (c) 1988, Prime Computer Inc. Mass.
  35.    this program can be copied, distributed and used to any purpose.
  36.    Prime Computer Inc, has no warrenty for any kind of damage done
  37.    by using this program or the results from it */
  38.  
  39. int day,month;
  40. int paaske(year)
  41. int year;
  42. {
  43.     int register b;
  44.     int a,c,d,e,f,g,h,i,j,k,l,m,n,p,x;
  45.  
  46.     a= year%19;
  47.     b=year/100;
  48.     c=year%100;
  49.     d=b/4;
  50.     e=b%4;
  51.     f = (b + 8)/25;
  52.     g = (b - f + 1)/3;
  53.     h = ((19 * a) + b - d - g + 15)%30;
  54.     i = c/4;
  55.     k = c%4;
  56.     l = ((2*e) + (2*i) + 32 - h -k)%7;
  57.     m = (a + (11*h) + (22*l))/451;
  58.     x=  (h + l - (7*m) + 114);
  59.     n = x/31;
  60.     p = x%31;
  61.     day = p + 1;
  62.     month= n;
  63. }
  64.  
  65.  
  66. --
  67.  Med Venlig Hilsen (With Kind Regards)
  68.  Niels S|ndergaard,
  69.  Prime Computer A/S, Denmark.
  70.  ns@pr1me.dk, {...}!mcvax!dkuug!pr1me!ns   or  ns@cph-d.Prime.COM
  71. -- 
  72.  Med Venlig Hilsen (With Kind Regards)
  73.  Niels S|ndergaard,
  74.  Prime Computer A/S, Denmark.
  75.  ns@pr1me.dk, {...}!mcvax!dkuug!pr1me!ns   or  ns@cph-d.Prime.COM
  76.