Hi guys, I use lazarus 2.1 with zeoslib 7.2 stable. When I compile from windows with target windows it works fine, when I use the cross compilation to cocoa (darwin 64 bit) any query that has a date returns me 00/00/0000.
Why? How can I make them work properly?
DateTime 00/00/0000
-
- Platinum Boarder
- Posts: 1999
- Joined: 17.01.2011, 14:17
Re: DateTime 00/00/0000
Hmmm - that sounds strange. Could you please provide a small sample application or sample procedure and a database script that demonstrate the problem? This greatly helps us in debugging the issue. Problem here is that no one of the team has a mac to test those things...
Re: DateTime 00/00/0000
Ok, into test.zip exists my lazarus example, my firebird backup test.fbk and one image of my execution with problem.
Idea?
Idea?
You do not have the required permissions to view the files attached to this post.
Re: DateTime 00/00/0000
To exclude that the problem was of lazarus or of fpc I tried to compile the same program without the zeos components and replacing them with the TIBConnection. As seen from the image with TIBConnection it works, so the problem is prorpio in zeos.
You do not have the required permissions to view the files attached to this post.
Re: DateTime 00/00/0000
I found the problem but I do not know how to solve it. The DateTimeToNative function exists in the ZDatasetUtils file.
Which has the following line
TDateTime (Buffer ^): = TimeStampToMSecs (TimeStamp);
If I put the following code
var
app2: comp;
...
app2: = TimeStampToMSecs (TimeStamp);
writeln (FloatToStr (app2));
I get the following values on windows
07/02/2019 21:42:20
floattostr: 63685258940708
and on the following macs
07/02/2019 22:14:33
floattostr: -9.22337203685478E18
I know that the two dates are different, but the fact that the value on the mac is negative leads me to think that there is a problem. Ideas on how to solve it?
Which has the following line
TDateTime (Buffer ^): = TimeStampToMSecs (TimeStamp);
If I put the following code
var
app2: comp;
...
app2: = TimeStampToMSecs (TimeStamp);
writeln (FloatToStr (app2));
I get the following values on windows
07/02/2019 21:42:20
floattostr: 63685258940708
and on the following macs
07/02/2019 22:14:33
floattostr: -9.22337203685478E18
I know that the two dates are different, but the fact that the value on the mac is negative leads me to think that there is a problem. Ideas on how to solve it?
Re: DateTime 00/00/0000
So, I installed lazarus + fpc on mac os directly. Before I did a cross compilation from windows. If I install the problem directly it does not exist. Now I do not understand if there is any kind of incompatibility or the problem has been solved at the fpc or lazarus level in this version I installed.
-
- Platinum Boarder
- Posts: 1999
- Joined: 17.01.2011, 14:17
Re: DateTime 00/00/0000
Hello xinyiman,
this sounds like a problem in FPC if a cross compiled executable behaves differently from an executable that was compiled by the native compiler. Maybe it makes sense to report that on the FPC mailing list or to open a bug report.
Best regards,
Jan
this sounds like a problem in FPC if a cross compiled executable behaves differently from an executable that was compiled by the native compiler. Maybe it makes sense to report that on the FPC mailing list or to open a bug report.
Best regards,
Jan
Re: DateTime 00/00/0000
Seems it's not a Zeos issue. Investigate further, are timestamp structures differ? Or binary representations of results of TimeStampToMSecs ?