I am new in Delphi
programming.
While going through the Data Types
in Delphi
I found TDateTime
.
While using it in my test application I come to know that the TDateTime
Object provide me a Float\Double
value.
I am little curious about TDateTime
How it calculate the Date Time
to Double
value.
Below is the example code which I had used:
var
LDateTime: TDateTime;
LFloat: Double;
begin
LDateTime := now;// current DateTime
LFloat:= LDateTime; // provide me a float value
end;
Is it using any formula to calculate Date and Time Value
from Windows?
Can anyone suggest/provide me for some more information about working of TDateTime
?
Thanks in advance.
TDateTime
is not an object; it is a typedef oftype double
. From System.pas:type TDateTime = type Double;
. There's no need to useLFloat
to do any sort of conversion; you can directly use aTDateTime
as a floating point value, as inMyDate := Now + 10;
(add 10 days). – Wack