DateTime 00/00/0000

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
xinyiman
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 09.06.2016, 19:35

DateTime 00/00/0000

Post by xinyiman »

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?
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1939
Joined: 17.01.2011, 14:17

Re: DateTime 00/00/0000

Post by marsupilami »

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...
xinyiman
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 09.06.2016, 19:35

Re: DateTime 00/00/0000

Post by xinyiman »

Ok, into test.zip exists my lazarus example, my firebird backup test.fbk and one image of my execution with problem.

Idea?
You do not have the required permissions to view the files attached to this post.
xinyiman
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 09.06.2016, 19:35

Re: DateTime 00/00/0000

Post by xinyiman »

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.
xinyiman
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 09.06.2016, 19:35

Re: DateTime 00/00/0000

Post by xinyiman »

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?
xinyiman
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 09.06.2016, 19:35

Re: DateTime 00/00/0000

Post by xinyiman »

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.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1939
Joined: 17.01.2011, 14:17

Re: DateTime 00/00/0000

Post by marsupilami »

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
Fr0sT
Zeos Dev Team
Zeos Dev Team
Posts: 280
Joined: 08.05.2014, 12:08

Re: DateTime 00/00/0000

Post by Fr0sT »

Seems it's not a Zeos issue. Investigate further, are timestamp structures differ? Or binary representations of results of TimeStampToMSecs ?
Post Reply