Inverse function of FormatDateTime

后端 未结 7 623
自闭症患者
自闭症患者 2021-02-07 04:38

I am looking for a function to reverse any string (YYYYMDD,YY/MM/DD,YYMMDD,...) created by the function FormatDateTime to

7条回答
  •  孤独总比滥情好
    2021-02-07 05:00

    I know its too late but just for interest sake, with Delphi XE6 onwards you can now do the following

    uses
      System.DateUtils;
    var
      dt: TDateTime;
    begin
      dt := ISO8601ToDate('20190408');
    end.
    

    dt will now be 2019/04/08

提交回复
热议问题