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,405 of 2,978   
   Heinrich Wolf to Heinrich Wolf   
   Re: Need a Pascal equivalent to C's diff   
   02 Mar 07 07:38:02   
   
   From: invalid@invalid.invalid   
      
   "Heinrich Wolf"  schrieb im Newsbeitrag   
   news:es8g0c$vca$1@news1.nefonline.de...   
   ...   
   > Type      GenaueZeit    = Record   
   >                            GrobeZeit : DateTime;   
   >                            S100      : Word;   
   >                          End;   
   >              JulianTime    = Extended;   
   >   
   > Function JulianischeZeit(Z : GenaueZeit) : JulianTime;   
   >  begin   
   >    With Z, Z.GrobeZeit do   
   >      JulianischeZeit :=   
   >        JulianischerTag(Year, Month,   
   >                        Day + ((((S100 / 100) + Sec) / 60   
   >                                + Min) / 60   
   >                               + Hour) / 24);   
   >  end;   
   >   
   > Function  JulianischerTag    (Jahr  : Integer; Monat: Word; Tag :   
   > JulianTime)   
   >          : JulianTime;   
   >          { -4712 <= Jahr = year < 4000   
   >            Monat = month: 1 = January to 12 = December   
   >            Tag = day; fraction = time since midnight   
   >            JulianischerTag begins at noon (!)   
   >            calculation valid before and after gregorian calendar   
   > reformation (!)   
   >            Oct 4, 1582 + 1 day = Oct 15, 1582 !   
   >          }  var    y, m  : LongInt;   
   ...   
      
   and then you easily convert JulianTime to time_t   
      
   function jt2time_t(t : JulianTime) : long;   
     const offset = { place julian time of Jan 1, 1970, 0:00:00 a.m. here! };   
     begin   
        jt2time_t := int((t - offset) * 24 * 60 * 60);   
     end;   
      
   --- 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