WebmyCloudData date fields and strings with special chars

Using Delphi 10.4, web core

I set up a myCloudData table with a field called date_stamp having type DateTime.

procedure TForm2.wBtnInsertClick(Sender: TObject);
  ent: TmyCloudDataEntity;
  tbl : TmyCloudDataTable;
  s: string;
  tbl := nil;
  //FTbNdx set earlier to the correct table index
  tbl := WebmyCloudData1.Tables.Items[FTbNdx]; 

   if Tbl<>nil then begin
     Ent := tbl.Entities.Add;
     Ent.Value['code']  :=  WebEdit1.Text;
     ... other fields
    s := FormatDateTime('YYYY-MM-DD HH:NN:SS',now);
    Ent.Value['date_stamp'] := S;

This fails no matter what I set the date formatting to.

I cleared the table, and changed the field date_stamp type to nvarchar[20].

That "add record" code still failed.

I tried with s := 'TEST'; and it succeeded.

I tried s:='2020-11-01' - success.

With s:='2020-11-01 14:20'; it also succeeded, but the data stored in the table is:


Clearly the data is being "url char encoded".

This explains why the nvarchar[20] failed to accept FormatDateTime('YYYY-MM-DD HH:NN:SS',now); - because the resulting value will be longer than 20 chars encoded this way.

It probably explains the failure in accepting the DateTime as well - if the "variant as string to datetime" function can't handle %20 and %3A either...

Am I missing something blindingly obvious (again)?

How should I be sending text with spaces/special chars to ensure the data is stored "correctly"?




Thank you for notifying us.
This issue has now been fixed and the update will be available with the next release of TMS WEB Core.