Top.Mail.Ru
Мастера DELPHI, Delphi programming community Титульная страница Поиск, карта сайта Написать письмо 
| Новости | Поиск | FAQ | Статьи | Книги | Новости VCL |
| Форумы ЧАТ | Орешник | KOL и MCK |
Форумы -» Основная («Начинающим»)/ Базы / WinAPI / Компоненты / Сети / Media / Игры / Corba и COM / KOL / FreePascal / .Net / Прочее / RSDN.ORG

« предыдущая ветвь | форум | следующая ветвь »

time difference [KOL]


Boguslaw ©   (2010-03-01 21:28:00) 

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;


Vladimir Kladov   (2010-03-02 18:35:00) [1]

What is dtStart? How it was calculated / obtained /... ?


Dufa   (2010-03-02 09:52:00) [2]

//[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.). }


Наверх

Титульная страница Поиск, карта сайта Написать письмо