I have an application shares some code, as shown below. In fpc is it is compiled to 64 bit, Delphi to 32 bit.
NewCommand.TimeOfExecution := Reader.ReadDate;
...
Writer.WriteDate(NewCommand.TimeOfExecution);
The code reads and writes a TDateTime to a stream using TReader and TWriter. The problem is when the fpc version has written the date, the Delphi version cannot read it properly. It evaluates in the debugger to 4.8866741388e+18 which is an invalid date, it is supposed to be something like 40452.730754. The exception in Delphi does not occur when it reads the date, but when I later try to show it to the user with StrToDate.
Elsewhere the application reads and writes strings, floats ints wth no issues. Does anyone know I can reliably read and write a TDateTime to a stream that will be compatible with Delphi and fpc (64-bit)? Many thanks for any help.