首页 > 其他分享 >Delphi获取Unix当前系统时间戳

Delphi获取Unix当前系统时间戳

时间:2022-11-03 20:46:00浏览次数:72  
标签:01 const Delphi TDateTime 获取 Unix ADate now

procedure TForm1.btn4Click(Sender: TObject);
  var Str :String;  D :tDatetime;
  a:Double;
  function DateTimeToUnixDate(const ADate: TDateTime): Longint;
  const
  cUnixStartDate: TDateTime = 25569.333; // 1970/01/01
  begin
    Result := Round((ADate - cUnixStartDate) * 86400);
  end;
begin
  Str := IntToStr(DateTimeToTimeStamp(Now).Date) + '' + IntToStr(DateTimeToTimeStamp(now).time);
  ShowMessage(InttoStr(DateTimeToUnixDate(now)));

end;

标签:01,const,Delphi,TDateTime,获取,Unix,ADate,now
From: https://www.cnblogs.com/victory97/p/16855774.html

相关文章