This piece of code converts seconds into "hours:minutes:seconds" format.
[pascal]
{ .: FormatTime :. }
function FormatTime(const TheTime: Integer): String;
var
Hours, Mins, Secs: Integer;
begin
if (TheTime > 0) then
begin
Mins := (TheTime div 60);
Secs := (TheTime mod 60);
Hours := (Mins div 60);
Mins := (Mins mod 60);
Result := Format('%.2d:%.2d:%.2d', [Hours, Mins, Secs]);
end else
Result := '00:00:00';
end;
[/pascal]