DELPHI 字符串与日期格式互转
procedure TForm1.Button1Click(Sender: TObject); var D:TDateTime; s:string; begin D:=VarToDateTime('05-10-14 04:35PM'); S:=FormatDatetime('YYYY/MM/DD HH:MM:SS',D); showmessage(s); end;
好的代码像粥一样,都是用时间熬出来的
procedure TForm1.Button1Click(Sender: TObject); var D:TDateTime; s:string; begin D:=VarToDateTime('05-10-14 04:35PM'); S:=FormatDatetime('YYYY/MM/DD HH:MM:SS',D); showmessage(s); end;