*** Answering a msg posted in area PERSONAL_MAIL (Personal mail).
Hello Gerry!
08 Jan 97 13:03, Gerry Danen wrote to WIM DE LANGE:
WDL>> Same remark, but use GOMONTH(a, -1200)
GD> Great! Common sense from my old country!
Grin. Are you from the Netherlands?
* Program....: EASTERN.PRG
* Version....: 1.0
* Author.....: Wim de Lange
* Date.......: 10 January 1997
* Notice.....: Copyright (c) 1997 Biochem Laboratorium bv, All Rights *
Reserved.
* Compiler...: FoxPro 2.6a
* Abstract...: Calculate Eastern
* Changes....:
PARAMETERS tuDatYear
PRIVATE ALL LIKE j*
DO CASE
CASE EMPTY(m.tuDatYear)
*c Empty, use DATE()
jdDate = DATE()
CASE TYPE("m.tuDatYear") = "N"
*c Numeric, means a Year
jcsDate = SET("DATE")
SET DATE DMY
jdDate = CTOD("01/01/"+ALLTRIM(STR(m.tuDatYear)))
SET DATE &jcsDate
CASE TYPE("m.tuDatYear") = "C"
*c Character? Ok, treat it as a date.
jdDate = CTOD(m.tuDatYear)
OTHERWISE
*c It's a Date
jdDate = m.tuDatYear
ENDCASE
jnYear = YEAR(m.jdDate)
jnCentury = INT(m.jnYear / 100)
jnG = m.jnYear % 19
jnK = (m.jnCentury - 17)/25
jnI = (m.jnCentury - INT(m.jnCentury/4) - INT((m.jnCentury - m.jnK)/3) + ;
19*m.jnG + 15) % 30
jnJ = (m.jnYear + INT(m.jnYear/4) + m.jnI + 2 - m.jnCentury + ;
INT(m.jnCentury/4)) % 7
jnL = m.jnI - m.jnJ
jdBase = GOMONTH(m.jdDate, - MONTH(m.jdDate)+1) - DAY(m.jdDate) + 1
jnMonth = 3 + INT((m.jnL+40)/44)
jnDay = m.jnL + 28 - 31*INT(m.jnMonth/4)
RETURN GOMONTH(m.jdBase, m.jnMonth-1) + m.jnDay -1
This algorithm is taken from Oudin for calculating the date of Easter in the
gregorian calender. And a rewrite (by me) from the algorithm by Claus
Tondering (to be found on Internet:
http://cssa.stanford.edu/~marcos/oudin.html).
Groetjes,
Wim
Fido: 2:281/535.11 CompuServe: 100142,604 Internet: wdelange@pi.net
--- FMail 0.94
---------------
* Origin: Zoetermeer, the Netherlands (2:281/535.11)
|