Конференция "KOL" » time difference [KOL]
 
  • Boguslaw (01.03.10 21:28) [0]
    How to compute how many hours/minutes/seconds are between two TDateTime in KOL ? Something is wrong.
    I tried this code from Delphi but it works wrong:

    dt := Now- dtStart;
    f :=  frac(dt);
    Hours := trunc(f*24);
    Minutes := trunc(f*24*60)-Hours*60;
    Seconds := trunc(f*24*60)-Hours*60-Minutes*60*60;
  • Dufa © (02.03.10 09:52) [1]
    //[TDateTime TYPE DEFINITION]
    type
     //TDateTime = Double; // well, it is already defined so in System.pas
     {* Basic date and time type. Integer part represents year and days (as is,
        i.e. 1-Jan-2000 is representing by value 730141, which is a number of
        days from 1-Jan-0001 to 1-Jan-2000 inclusively). Fractional part is
        representing hours, minutes, seconds and milliseconds of a day
        proportionally (like in VCL TDateTime type, e.g. 0.5 = 12:00, 0.25 = 6:00,
        etc.). }
  • Vladimir Kladov © (02.03.10 18:35) [2]
    What is dtStart? How it was calculated / obtained /... ?
 
Конференция "KOL" » time difference [KOL]
Есть новые Нет новых   [134431   +10][b:0][p:0]