[fpc-devel] DB Bug in 2.0.1?

Tony Maro tony at maro.net
Thu Jul 21 02:31:02 CEST 2005


Jonas Maebe wrote:

>
> On 21 jul 2005, at 00:40, Tony Maro wrote:
>
>> Can someone confirm the date issue for me?
>
>
> I can't confirm it, but I do want to mention that I fixed all  
> datetime-related routines for *nix platforms in sysutils a while ago.  
> They operated based on the supposition that the dates they get are in  
> Windows format, as opposed to the number of seconds since x/x/1970.

I have a concern on that - and please keep in mind I've not even looked 
at the code, so I don't know if it's an issue or not.

My main purpose in using FPC is to write cross-platform applications.  
 From what I gather, I'll now need to understand that TDateTime doesn't 
actually store things the same way on different OS's?  I know, FPC's 
goal is not specifically Delphi compatibility, but...

Here's a quote I found online:
"In Delphi for Win32 (and Kylix), TDateTime is defined as a Double 
(64-bit floating-point number). Date and time information is stored as 
the count of days since midnight on 30-Dec-1899."

Here you can see that even Kylix uses the same methodology in storing 
TDateTime values.

I can see both perspectives, but if the idea is to make it easier to 
develop cross-platform software, I'd expect TDateTime to be stored the 
same way across platforms regardless of how the OS counts.  A lot of 
software written for Delphi is going to be awfully hard to convert for 
Linux, Mac, etc if TDateTime is stored differently everywhere.

-Tony




More information about the fpc-devel mailing list