On Wed, 30 Nov 2005, Joost van der Sluis wrote:

> > I am developing my first app using Lazarus and now I have found a serious 
> > problem with date with Lazarus. This show me a date 1/10/1899. I have been 
> > in zeos forum and they say that problem is for FPC not zeos. Somebody says 
> > that the problem is with the structure that use Lazarus to see the date, 
> > before like delphi 2,3,4 , but now it uses the nwe form Tdatetime and the 
> > problems it is. Really this problem is from compiler.

Not the compiler, the RTL or FCL.

> > So0mebody here has a cluee how can we resolve this problem??
> > I am using Lazarus so heavy and I dont wanna go to anyplace!!
> > Really , Lazarus is a good job!!!
> 
> First we need to know which versions of fpc and lazarus you're using.
> 
> The latest versions of fpc uses the same system for date fields as
> Delphi 6 and higher. If ZEOS doesn't support this system, and still
> relies on the Delph-2 system, it's a problem of ZEOS, I would say.

No, it's a FPC problem. 

Delphi actually does a dirty trick with the 'NativeFormat' parameter of 
GetFieldData. If NativeFormat is false, it does a recursive call of 
itself with a temporary buffer, and then converts the data with 
an auxiliary method.

This method takes care of the conversion TTimeStamp -> TDateTime 
because TDateTimeField sets calls GetFieldData with NativeFormat
set to False.

So we had to fix this in TDataset. 
I've done it, it's committed, if someone could please give it a test, 
I would be grateful.

This means that a TDataset Descendent always should use the OLD method, 
or must override the DataConvert method so it does NOT do the conversion 
again in the case of datetime fields.

Michael.

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to