delphi获取开机时间代码


delphi获取开机时间代码

var
T1: Int64;
T2,T3: Comp;
T4: TDateTime;
begin
T1 := GetTickCount; {从开机到现在的毫秒数}
T2 := TimeStampToMSecs(DateTimeToTimeStamp(Now)); {从 0001-1-1 到当前时间的毫秒数}
T3 := T2 - T1; {从 0001-1-1 到开机时刻的毫秒数}
T4 := TimeStampToDateTime(MSecsToTimeStamp(T3)); {从 0001-1-1 到开机时刻的时间}
ShowMessage(DateTimeToStr(T4)); {显示开机时间}
end;

联系电话:
020-00000000
联系电话:
020-00000000
联系电话:
020-12345678