Hi,
Does anyone know why the following code returns the correct days uptime in
XP, but doesn't in Windows 8? (not tested in anything other)
Also, is it close to working correctly in Linux as well?
Thanks in advance
Richard
function TfrmMain.GetDaysUptime: integer;
var
TickCount: variant;
mySeconds: variant;
dys,hrs,min,sec : variant;
begin
TickCount := LclIntf.GetTickCount;
mySeconds := TickCount Div 1000;
hrs := (mySeconds Div 60) Div 60;
mySeconds := mySeconds - (hrs * 60 * 60);
min := mySeconds Div 60;
mySeconds := mySeconds - (min * 60);
sec := mySeconds;
if hrs >= 24 then
dys := hrs Div 24
else
dys := 0;
Result := dys;
end;
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus