Delphi XE string and date format Mutual Convert

procedure TForm1.btn1Click(Sender: TObject);
var
D:TDateTime;
s:string;
begin
D:=VarToDateTime('20-01-01 04:35PM');
S:=FormatDatetime('YYYY-MM-DD HH:MM:SS',D);
showmessage(s);
end;

 

See someone so used VarToDateTime, survive, pass to kill the powerful date

See someone so used VarToDateTime, survive, pass to kill the powerful date

Guess you like

Origin www.cnblogs.com/redhat588/p/12175662.html