N nicai_wgl Unregistered / Unconfirmed GUEST, unregistred user! 2006-09-15 #2 Time1, Time2: TDateTime; (Time1 - Time2) * 24 * 3600 既是两个时间的秒差。
C carrie4002 Unregistered / Unconfirmed GUEST, unregistred user! 2006-09-15 #3 Time1和Time2需要在不同的地方获取,怎样在需要的地方为这两个变量赋值呢?
L lzylogic Unregistered / Unconfirmed GUEST, unregistred user! 2006-09-15 #4 用以下的函数: Time1:=now; time2:=now;
C carrie4002 Unregistered / Unconfirmed GUEST, unregistred user! 2006-09-15 #5 Time1:=now;//这句,编译时类型不匹配 ??
C carrie4002 Unregistered / Unconfirmed GUEST, unregistred user! 2006-09-15 #7 Time1:=now;//这句,编译时类型不匹配 ?? Date返回当前日期,Time返回当前时间,Now返回当前日期和时间。 到底该如何转化???
C carrie4002 Unregistered / Unconfirmed GUEST, unregistred user! 2006-09-15 #9 照你的代码,我取出来的是"日期+时间"。 我需要的只是时间,并转化为秒数。 谢谢。急啊........
M myhby Unregistered / Unconfirmed GUEST, unregistred user! 2006-09-15 #10 var Time1,Time2:TDateTime; s :integer; begin time1:=now; ... ... time2:=now; s:=round(time2-time1)*24*60*60); end;
var Time1,Time2:TDateTime; s :integer; begin time1:=now; ... ... time2:=now; s:=round(time2-time1)*24*60*60); end;
菜 菜鸟黄 Unregistered / Unconfirmed GUEST, unregistred user! 2006-09-15 #11 procedure TForm2.Button1Click(Sender: TObject); var Time1,Time2:TDateTime; begin time1:=time; sleep(3000); time2:=time; Label1.Caption :=Timetostr(time2-time1); end;
procedure TForm2.Button1Click(Sender: TObject); var Time1,Time2:TDateTime; begin time1:=time; sleep(3000); time2:=time; Label1.Caption :=Timetostr(time2-time1); end;
5 52free Unregistered / Unconfirmed GUEST, unregistred user! 2006-09-15 #12 s: Double; dBegin, dEnd: word; dBegin := GetTickCount; Do Somthing dEnd := GetTickCount; s := (dEnd - dBegin) / 1000
s: Double; dBegin, dEnd: word; dBegin := GetTickCount; Do Somthing dEnd := GetTickCount; s := (dEnd - dBegin) / 1000
M muhx Unregistered / Unconfirmed GUEST, unregistred user! 2006-09-25 #13 Delphi中有函数实现 SecondsBetween(ANow, AThen: TDateTime): Integer; 查查这个函数的帮助吧
K kevin3000 Unregistered / Unconfirmed GUEST, unregistred user! 2006-12-04 #14 用函数DecodeTime(Time1,Hour,Min,Sec,MSec)可将当前时间分解为Hour(小时数)、Min(分钟数),Sec(秒数),MSec(毫秒数),你可以直接使用这几个变量。
C carrie4002 Unregistered / Unconfirmed GUEST, unregistred user! 2006-12-04 #15 谢谢各位。DecodeTime()满足我的要求。简单一些。 结贴。