TIP: Click on subject to list as thread! ANSI
echo: foxpro
to: GERRY DANEN
from: WIM DE LANGE
date: 1997-01-10 12:20:00
subject: YEAR 2000 BUG FIX

*** 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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.