本文整理自网络,侵删。
delphi 时间到就触发事件
var
S,D:tdatetime;
begin
Label1.Caption:=FormatDateTime(' hh:mm:ss',Now); //此时
//S:=FormatDateTime(' hh:mm:ss',Now);
s:=strtodatetime(Label1.Caption);
D:=strtodatetime('14:01:02'); //到达时间 --你自己定;
if s=d then
begin
showmessage('Y');
// 这中间你加入你自己要 执行的数据库语句
end;
end;
相关阅读 >>
Delphi 10.3.x 截取字符串函数substring 和copy()常用字串符处理函数用法
Delphi10.3通过rest单元使类和json数据互相转换
Delphi读取webbrowse中的图片显示在image中
Delphi7 中tstringlist的delimiter delimitedtext有bug,字符串分割有问题
Delphi winapi: movewindow - 改变窗口的位置与大小
更多相关阅读请进入《Delphi》频道 >>