This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/tai/libtai/caldate_ster.c

25 lines
469 B
C
Raw Normal View History

2010-07-19 14:52:26 +01:00
#include "tai.h"
#include "caldate.h"
void caldate_easter(struct caldate *cd)
{
long c;
long t;
long j;
long n;
long y;
y = cd->year;
c = (y / 100) + 1;
t = 210 - (((c * 3) / 4) % 210);
j = y % 19;
n = 57 - ((14 + j * 11 + (c * 8 + 5) / 25 + t) % 30);
if ((n == 56) && (j > 10)) --n;
if (n == 57) --n;
n -= ((((y % 28) * 5) / 4 + t + n + 2) % 7);
if (n < 32) { cd->month = 3; cd->day = n; }
else { cd->month = 4; cd->day = n - 31; }
}