[fpc-devel] DB Bug in 2.0.1?

Michael Van Canneyt michael at freepascal.org
Thu Jul 21 05:05:40 CEST 2005



On Wed, 20 Jul 2005, Tony Maro wrote:

> 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.

The TDateTime value itself is not the issue. It is the same on all platforms, 
and compatible to Delpi.

> 
> 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.

It is not. 

If I remember correctly, there have been some fixes on the internal Date/Time 
field buffer format of TDataset, and I suppose your problem is a result of that 
change. 

Michael.




More information about the fpc-devel mailing list