From: invalid@invalid.invalid   
      
   "Dr J R Stockton" schrieb im Newsbeitrag   
   news:qTaXG1ot5J6FFwKw@invalid.uk.co.demon.merlyn.invalid...   
   > In comp.lang.pascal.borland message , Fri, 2 Mar   
   > 2007 00:54:51, Stephen posted:   
   >>I'm using the GetDate and GetTime procedures from the DOS unit to   
   >>obtain the date and time. What I am trying to figure out is how to   
   >>write a function that will work exactly like C's standard library   
   >>function 'difftime()', which returns the difference in *seconds*   
   >>between time1 and time2.   
   >   
   > GetDate and GetTime take no cognisance of Time Zone or Summer Time. I   
   > suspect that C difftime may do so, in which case to get an exact   
   > equivalent you will need to code and maintain appropriate Sunner Time   
   > rules.   
      
   You are right in some point!   
   This function, I posted is too simple.   
      
   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;   
      
   It is valid only for Hour, Min and Sec as GMT.   
   You cannot simply insert GetTime here,   
   but must shift that by time zone and daylight saving offset.   
      
   C mktime() does that.   
   But for C difftime() that does not make a difference.   
   When time1 is wrong by the timezone and time2 is wrong by the same amount,   
   then the difference results to 0.   
      
   Regards   
   Heiner   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|