You are not logged in.
Pages: 1
Hello,
I am using Delphi 12.2 and mORMot2 from September 24, 2024
As to my tests below code sample is not de-serialized
uses
mormot.core.base,
mormot.core.json;
type
TTest = packed record
adate: TDate;
end;
procedure TForm1.Button1Click(Sender: TObject);
const
cTest = '{"adate":"2025-01-01"}';
var
LData: TTest;
begin
mormot.core.json.RecordLoadJson(LData, RawUtf8(cTest), TypeInfo(TTest));
end;
The same json string can be de-serialized if I change TDate -> TDateTime in record.
I wonder if TDate datatype is not supported?
Thanks & Regards,
Ertan
Offline
Tested and found no problems.
Thank you.
Offline
how about : cTest = '[{"adate":"2025-01-01","name":"abc", "age":20},{"adate":"2025-01-02","name":"json", "age":12} ]';
Offline
oh,
aTestDynArray: array of TTTest;
DynArrayLoadJson(aTestDynArray, cTest, TypeInfo(array of TTTest));
Last edited by vga (2025-01-18 02:21:42)
Offline
Pages: 1