Consistently use FormatTimeNumber() also for formatting server uptime. Leave out the day portion if zero.

This commit is contained in:
Ansgar Becker
2009-11-23 21:24:25 +00:00
parent db3fbd0df7
commit cdb936b77d
2 changed files with 12 additions and 16 deletions

View File

@ -2036,14 +2036,19 @@ end;
}
function FormatTimeNumber( Seconds: Cardinal ): String;
var
h, m, s : Integer;
d, h, m, s : Integer;
begin
s := Seconds mod (60*60*24);
s := Seconds;
d := s div (60*60*24);
s := s mod (60*60*24);
h := s div (60*60);
s := s mod (60*60);
m := s div 60;
s := s mod 60;
Result := Format('%.2d:%.2d:%.2d', [h, m, s]);
if d > 0 then
Result := Format('%d days, %.2d:%.2d:%.2d', [d, h, m, s])
else
Result := Format('%.2d:%.2d:%.2d', [h, m, s]);
end;