var
Present: TDateTime;
Hour, Min, Sec, MSec: Word;
BEGIN
Present:= Now;
DecodeTime(Present, Hour, Min, Sec, MSec);
if Hour>17 then
begin
close;
end;
END;
// Timer1.InterVal in [50..59000]
procedure Timer1OnTimer();
var sh:byte;
begin
if (MinuteOf(Time)=30) then begin
sh:=HourOf(Time);
if (sh in [8,11,13,17])and(mh<>sh) then begin
mh:=sh;
// your codes
end;
end;
end;