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;