home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,045 of 2,978   
   Dr John Stockton to All   
   Re: Calculate the string statement   
   11 Feb 06 23:23:58   
   
   From: jrs@merlyn.demon.co.uk   
      
   JRS:  In article <456fvfF53l0cU1@individual.net>, dated Sat, 11 Feb 2006   
   16:59:43 remote, seen in news:comp.lang.pascal.borland, Heinrich Wolf   
    posted :   
   > ...   
   >{ Folgende Funktionen sind realisiert nach   
   >  "Astronomical Formulae for Calculators, third edition"   
   >  von Jean Meeus.   
   >}   
   >Function  JulianischerTag    (Jahr  : Integer; Monat: Word; Tag :   
   >JulianTime)   
   >          : JulianTime;   
   >          { -4712 <= Jahr < 4000   
      
   There's no need to stop at 4000; the Gregorian calendar is valid   
   indefinitely.  Neither is there any need to start at BC 4713; negative   
   JDN can be used.  I have Pascal that can calculate with dates and times   
   within about the years +-16^65520, and +-16^99999999 if compiled in   
   Delphi.   
      
   >            Monat 1 = Januar bis 12 = Dezember   
   >            Tag Bruchteil = Zeit seit Mitternacht   
   >            JulianischerTag beginnt mittags   
   >            Berechnung gltig vor und nach gregorianischem Kalender   
   >            4.10.1582 + 1 = 15.10.1582   
      
   That's possibly imperfect, since the Julian date number changes at noon   
   GMT (or UT) and your code appears to change at local time.   
      
   You just need to change it to, I think, ChronologischerJulianischerTag   
   and maybe adjust by 0.5.   
      
   Only the most Papist countries omitted 1582 October 5..14; it seems   
   wrong to hard-code that date.   
      
      
   >Procedure CheckSchaltjahr;   
   >  Begin   
   >    if Jahr > 1582 Then   
   >      if (Jahr mod 400 = 0) or (jahr mod 4 = 0) and (jahr mod 100 > 0) then   
      
   For efficiency, although the difference will be imperceptible, the tests   
   should be in the order 4, 100, 400 (unless the compiler is very clever).   
      
      
      
   >function OsterOffset;   
   >  {   
   >  Die Formel ist der Zeitschrift 'Funkschau' entnommen.   
   >  Sie ist in Heft 5 des Jahrgangs 1980 auf Seite 77 zu finden und wurde   
   >  im Zusammenhang mit einem Programm fuer den Taschenrechner TI 59   
   >  veroeffentlicht.   
   >  }   
   >  const m  : array[15 .. 22] of integer =   
   >               (22, 22, 23, 23, 24, 24, 24, 25);   
   >        n  : array[15 .. 22] of integer =   
   >               (2, 2, 3, 4, 5, 5, 6, 0);   
   >  var   jh,   
   >        f,   
   >        g  : integer;   
   >  begin   
   >    jh := jahr div 100;   
   >    f  := (19 *    (jahr mod 19) + m[jh]) mod 30;   
   >    g  := f + (2 * (jahr mod  4) + 4 * (jahr mod 7) + 6*f + n[jh]) mod 7;   
   >    osteroffset := g;   
   >    if g = 35 then   
   >      osteroffset := 28;   
   >    if (g = 34) and (f = 28) and (jahr mod 19 > 10) then   
   >      osteroffset := 27;   
   >  end;   
      
   I don't recognise that exact method.  It looks more complex than is   
   needed to cover 1900..2199, but possibly not complex enough to cover all   
   positive years.  Do you know its limits?   
      
   Of course, if the secular calendar changes from Julian to Gregorian in   
   Year X, here 1582, then the religious calendar should make the   
   corresponding change.   
      
      
      
   I have Pascal/Delphi date routines in dateprox.pas, via sig line 3.  The   
   year range is a little smaller than the Pascal integer range, but   
   exceeds +-30000 years; the day count is CMJD, with 1858-11-17 local time   
   being day zero.   
      
   I also have Zeller date material via sig line 2, including images of the   
   papers; you won't need all the translations.  And derived javascript   
   routines, more recent than the Pascal.   
      
   --   
    © John Stockton, Surrey, UK.  ?@merlyn.demon.co.uk   Turnpike v4.00   MIME. ©   
    Web   - w. FAQish topics, links, acronyms   
    PAS EXE etc :  - see 00index.htm   
    Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca