if time()<strtotime('10:20:00') then showmessage('测试通过'); 试一试,朋友
procedure TForm1.Button1Click(Sender: TObject); var S: string; begin S := FormatDateTime('HH:NN', Now); if (S >= '08:20') and (S <= '12:20') then ShowMessage('a') else if (S >= '12:21') and (S <= '19:20') then ShowMessage('b') else if (S >= '19:21') and (S <= '23:00') then ShowMessage('c') else ShowMessage('d'); end;
来一个我自认为好的办法吧 if Time >= StrToTime('8:20:00') then ShowMessage('测试通过'); ~~~~@1 ~~~~~~~~~@2@1取得当前时间,不知是否有此函数, @2把字符型转换成时间型,不知是否有此函数,因为,无论日期还是时间型,都可以转换成Int 或 Real等类型的//偶?!也配来回答问题?!函数都不知道 //唉,没戏了,得不了分了,~~~~~~~~~5555555555
showmessage('测试通过');
showmessage('测试通过');
12:21~19:20 做b事情
19:21~23:00 做c事情
23:01~第2天8:19 做d事情这应该怎么写???
showmessage('测试通过');
试一试,朋友
var
S: string;
begin
S := FormatDateTime('HH:NN', Now);
if (S >= '08:20') and (S <= '12:20') then
ShowMessage('a')
else if (S >= '12:21') and (S <= '19:20') then
ShowMessage('b')
else if (S >= '19:21') and (S <= '23:00') then
ShowMessage('c')
else ShowMessage('d');
end;
if Time >= StrToTime('8:20:00') then ShowMessage('测试通过');
~~~~@1 ~~~~~~~~~@2@1取得当前时间,不知是否有此函数,
@2把字符型转换成时间型,不知是否有此函数,因为,无论日期还是时间型,都可以转换成Int 或 Real等类型的//偶?!也配来回答问题?!函数都不知道
//唉,没戏了,得不了分了,~~~~~~~~~5555555555