Solved

# How to calc minutes to Week - Days- Hours- Min of a working 1 days = 8 hours en 40 hours = 1 week

Posted on 2006-06-22

Hoi,

I have make somthing, but it wont work correcly.

Please help my

inttotimestr(2123333) = result 73d 05:43:04:53 ????????

function inttotimestr(S: integer): string; // z.B. 3600-> '01:00:00'

var

st:string;

ti,t:integer;

begin

try

st:='';

if (s > 28800) then begin

st:=inttostr(s div 28800)+'d ';

end;

s:=s mod 28800;

if (s div 480) = 0 then

st:=st+'00:'

else if (s div 480) < 10 then

st:=st+'0'+inttostr(s div 480)+':'

else

st:=st+inttostr(s div 480)+':';

ti:=s mod 480;

if (ti div 60) = 0 then

st:=st+'00:'

else if (ti div 60) < 10 then

st:=st+'0'+inttostr(ti div 60)+':'

else

st:=st+inttostr(ti div 60)+':';

t:=ti mod 60;

if t = 0 then

st:=st+'00'

else if t < 10 then

st:=st+'0'+inttostr(t)

else

st:=st+inttostr(t);

except

st:='00:00:00';

end;

inttotimestr:=st;

end;