🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.vbasic
Article #92765

Re: Excel i święta

#92765
From: Marcin Miga
Date: Thu, 10 Nov 2005 14:17
33 lines
1471 bytes
Artur S. wrote:

> 3. mamy dwa święta ruchome, zależne od siebie (59 dni różnicy).
> Istnieją algorytmy wyliczania, kiedy wypada poniedziałek wielkanocny,
> ale nie mam pod ręką.

Public Function GetEasterDate(ByVal intYear As Integer) As Date
Dim G%, C%, H%, i%, J%, L%, M%, D%, Y%
Dim dtTemp As Date

G = intYear Mod 19
C = intYear \ 100
H = (C - (C \ 4) - ((8 * C + 13) \ 25) + 19 * G + 15) Mod 30
i = H - (H \ 28) * (1 - (H \ 28) * (29 \ (H + 1)) * ((21 - G) \ 11))
J = (intYear + intYear \ 4 + i + 2 - C + C \ 4) Mod 7
L = i - J
M = 3 + (L + 40) \ 44
D = L + 28 - 31 * (M \ 4)
Y = intYear
dtTemp = DateSerial(Y, M, D)

Do While Weekday(dtTemp) <> 1
    DateAdd "d", 1, dtTemp
Loop
GetEasterDate = dtTemp

End Function

pozdrawiaMM
PS. Gauss
-- 
Marcin M. Miga
"More matter with less art"
Technical Details
Message-ID: <C57BDD8470737A4D9F2CE5DEE25D7B9007FB9B75@mailserver2.domdata.local>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!nf1.ipartners.pl!ipartners.pl!helios.domdata.com!DOMDATA3.BAUBODEN.com
References: <1717.00000365.4373299a@newsgate.onet.pl> <dkvj2a$6j0$1@nemesis.news.tpi.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!nf1.ipartners.pl!ipartners.pl!helios.domdata.com!DOMDATA3.BAUBODEN.com
NNTP-Posting-Host: 192.168.151.148
Newsgroups: pl.comp.lang.vbasic
Date: Thu, 10 Nov 2005 15:17:02 +0100
Message-ID: <C57BDD8470737A4D9F2CE5DEE25D7B9007FB9B75@mailserver2.domdata.local>
From: "Marcin Miga" <Marcin.Miga[@]gmail.com>
Subject: Re: Excel i święta
References: <1717.00000365.4373299a@newsgate.onet.pl> <dkvj2a$6j0$1@nemesis.news.tpi.pl>
User-Agent: XanaNews/1.17.5.9
MIME-Version: 1.0
Lines: 34
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit