var
CurrTime:string;
CurrTime := FormatDateTime('HHMM',Now);
if (CurrTime >= '0800') and (CurrTime < '1200') then
begin
//在设定的8点到12点这个时间段
end
else
begin
//不在设定的8点到12点这个时间段
end;
直接用当前时间与规定时间进行比较就可以了。
取得当前日期函数date.
if (date>DateTimePicker1.date) and (date
end;
如果是字符型的日期格式,可以转换一下。
if (date>StrToDate(strdate1) ) and (date
end;
恩,楼上的没错
变红就是shape1.color:=clred;
变绿就是shape1.color:=clgreed;