Announcement

Collapse
No announcement yet.

Datum von Ostern berechnen

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Datum von Ostern berechnen

    Ich habe vor einiger Zeit gelesen, dass man das Datum von Ostern für die entsprechenden Jahre berechnen kann.
    Weiß jemand wie das geht?

    [email protected]

  • #2
    Hier ist ein Ausschnitt aus der Jedi Code Libary<br>
    function EasterSunday(Year: Integer): TDateTime;<br>
    {----------------------------------------------------------------}<br>
    { Calculates and returns Easter Day for specified year. }<br>
    { Originally from Mark Lussier, AppVision <[email protected]>. }<br>
    { Corrected to prevent integer overflow if it is inadvertently }<br>
    { passed a year of 6554 or greater. }<br>
    {----------------------------------------------------------------}<br>
    var<br>
    nMonth, nDay, nMoon, nEpact, nSunday,<br>
    nGold, nCent, nCorx, nCorz: Integer;<br>
    begin<br>
    { The Golden Number of the year in the 19 year Metonic Cycle: }<br>
    nGold := (Year mod 19) + 1;<br>
    { Calculate the Century: }<br>
    nCent := (Year div 100) + 1;<br>
    { Number of years in which leap year was dropped in order... }<br>
    { to keep in step with the sun: }<br>
    nCorx := (3 * nCent) div 4 - 12;<br>
    { Special correction to syncronize Easter with moon's orbit: }<br>
    nCorz := (8 * nCent + 5) div 25 - 5;<br>
    { Find Sunday: }<br>
    nSunday := (Longint(5) * Year) div 4 - nCorx - 10;<br>
    { ^ To prevent overflow at year 6554}<br>
    { Set Epact - specifies occurrence of full moon: }<br>
    nEpact := (11 * nGold + 20 + nCorz - nCorx) mod 30;<br>
    if nEpact < 0 then<br>
    nEpact := nEpact + 30;<br>
    if ((nEpact = 25) and (nGold > 11)) or (nEpact = 24) then<br>
    nEpact := nEpact + 1;<br>
    { Find Full Moon: }<br>
    nMoon := 44 - nEpact;<br>
    if nMoon < 21 then<br>
    nMoon := nMoon + 30;<br>
    { Advance to Sunday: }<br>
    nMoon := nMoon + 7 - ((nSunday + nMoon) mod 7);<br>
    if nMoon > 31 then<br>
    begin<br>
    nMonth := 4;<br>
    nDay := nMoon - 31;<br>
    end<br>
    else<br>
    begin<br>
    nMonth := 3;<br>
    nDay := nMoon;<br>
    end;<br>
    Result := EncodeDate(Year, nMonth, nDay);<br>
    end;<br&gt

    Comment


    • #3
      Schau mal auf www.delphi-download.de vorbei, da kannst du dir Quellcode mit Beispiel runterladen.

      mfg Klaus-Pete

      Comment

      Working...
      X