[fpc-pascal]Question about DATE handling...
memsom at interalpha.co.uk
Thu Mar 22 16:34:36 CET 2001
>Next, the result of StrToDate() is tDateTime. I can basically live with this,
>but: How can I add a specific number of days to this date? (I must calculate
>end date from start-date plus num of days!)
TDateTime (if it works like the Delphi type of the same name) works in the following
TDateTime = Double;
The part before the Decimal point is the date, the part after is the 'time'.
T := 0; // 30/12/1899 (Delphi 2+)
T := 1; // 31/12/1899
you can therefore summise that each whole digit = 1 day.
therefore, 'today' = number of days since 30/12/1899
0.000012 = 1 second (00:00:01)
0.000024 = 2 seconds (00:00:02)
>Normally, I use EpochTime as internal date format for all of that, so I
>can simply add/subtract seconds -- and this is perfect.
>--> But how can I get an epoch time out from tDateTime?
Take a look at:
Hope that helps,
More information about the fpc-pascal