function days(tfrom, tto:TDateTime):double;
var
t:TDateTime;
begin
t:= tfrom - trunc(tfrom);
if (t > 0.25) then //6:00
tfrom := trunc(tfrom) + 0.25
else
tfrom := trunc(tfrom) - 0.75;
t:= tto - trunc(tto);
if (t > 0.75) then //18:00
tto := trunc(tto) + 1.25
else if (t > 0.25) then
tto := trunc(tto) + 0.75
else
tto := trunc(tto) + 0.25;
result := tfrom - tto;
end;
var
t:TDateTime;
begin
t:= tfrom - trunc(tfrom);
if (t > 0.25) then //6:00
tfrom := trunc(tfrom) + 0.25
else
tfrom := trunc(tfrom) - 0.75;
t:= tto - trunc(tto);
if (t > 0.75) then //18:00
tto := trunc(tto) + 1.25
else if (t > 0.25) then
tto := trunc(tto) + 0.75
else
tto := trunc(tto) + 0.25;
result := tfrom - tto;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货