Why is there a difference between the conversion of a date in Delphi and SQL Server with these commands:
SQL Server :
SELECT CAST(GETDATE() AS FLOAT)
Delphi :
writeln(floattostr(now));
Example: For today
SQL Server = 40871.431264506
Delphi = 40873.4333729861
Why are the two results different?
Because many languages have different ways of dealing with dates internally. They may or may not store them internally as a float, and may also start counting at different “starting” dates. For instance, Delphi starts at 12/30/1899 (a TDateTime of 0).
See also this link.