当前位置:主页>销售管理软件> 列表

请问倒计时的功能的更好的办法 找电子商务进销存

记账软件版1楼: 我只想实现一个功能,每天开机时提示离某特定日期的剩余天数,以下是我的代码,但结果
不准确,我想请教更好的方法。(不使用控件)
procedure TForm1.To_less;//计算离2006年5月1日的剩余天数
var
FinallyTime:TSystemtime;
Ft:TDateTime;
temp:Double;
begin
FinallyTime.wYear:=2006;
FinallyTime.wMonth:=5;
FinallyTime.wDay:=1;
FinallyTime.wHour:=0;
FinallyTime.wMinute:=0;
FinallyTime.wSecond:=0;
FInallyTime.wMilliseconds:=0;
Ft:=SystemTimeToDateTime(FinallyTime);
temp:=Ft-now+0.5;//加0.5只是想结果接近些
ShowMessage(''离考试还有''+format(''%1.0f'',[temp])+''天,抓紧时间喔!'');
// Edit1.Text := format(''%1.0f'',[temp]);
end;

2楼: SQL语句
select datediff(day,GETDATE(),''2006-05-1'') 如电子商务进销存

3楼: To XUEXI666:
如果不用数据库控件,你说的这句SQL语句放哪里,是不是要先uses 什么单元啊?

4楼: var
t1:TDateTime;
begin
t1 := StrToDate(''2006-05-01'');
ShowMessage(''离考试还有''+IntToStr((Trunc(t1)-trunc(now)))+''天'');
end;

5楼: Delphi先锋网 文章又更新了,快去看呀
www.topdelphi.net

6楼: 谢谢各位的帮忙,结帖了。

记账软件版7楼: 用delphi的日期时间函数就可以了.
{use DateUtils}
var
FinallyTime:Tdatetime;
temp:integer;
begin
FinallyTime:=strtodatetime(''2006-5-1 00:00:00'');
temp:=DaysBetween(now,finallytime);
ShowMessage(''离考试还有''+inttostr(temp)+''天,抓紧时间喔!'');
end;