uses DateUtils;
procedure TForm1.Button1Click(Sender: TObject);
var
unix_time:int64;
begin
//系统时间转化成unix时间戳
unix_time:=Datetimetounix(strToDateTime(‘2010-05-01 00:00:00’));
Memo1.Lines.Add(IntToStr(unix_time));
//unix时间戳转化为系统时间
Memo1.Lines.Add(DateTimeToStr(UnixToDateTime(unix_time)));
end;
发表评论