Conversion with StrToDateTime and TFormatSettings does not work

后端 未结 2 1871
旧巷少年郎
旧巷少年郎 2020-12-16 13:23

This code should work in Delphi XE2, but it gives \"not a valid date and time\" error in StrtoDateTime conversion:

procedure TForm2.Button1Click(Sender: TObj         


        
2条回答
  •  粉色の甜心
    2020-12-16 14:19

    You have two issues

    1. You can't use a WhiteSpace as DateSeparator, because the internal routines to parse the string uses this character to determine the date and time parts of the string.

    2. The StrToDateTime function does not work when the months part use the mmm string, this is reported in this QC 23301

提交回复
热议问题