procedure TForm1.Button1Click(Sender: TObject); var d : TDateTime; begin d := StrToDateTime('2006-11-11 00:00:00'); d := d+20/1440; ShowMessage(DateTimeToStr(d)); end;
多谢,多谢,搞定了,我自己用了办法: d := d+20/60/24; 和 wudi_1982(闲半年了,要挣点钱过年了!) 方法一样; lihuasoft(学习低调做人) 的更好些! 马上结贴.给分了.
var
t1,t2 : TDateTime;
begin
t1 := StrToDateTime('2006-12-13 00:00:00');
t2 := StrToDateTime('2006-12-13 01:50:00');
caption := IntToStr(round( MinuteSpan(t1,t2) ))
end;
var t1,t2 :TDateTime;
begin
t1:=StrToDateTime('2006-12-29 17:00:01');
t2:=StrToDateTime('2006-12-29 17:30:01');
ShowMessage(inttostr(MinutesBetween(t1,t2)));
end;
procedure TForm1.Button1Click(Sender: TObject);
var t1,t2 :TDateTime;
begin
t1:=StrToDateTime('2006-12-13 00:00:00');
t2:=StrToDateTime('2006-12-13 01:50:00');
ShowMessage(inttostr(Round((t2-t1)*1440 )));
end;
///t2-t1就为两者相差的天数(double),将它化为分就可以了
procedure TForm1.Button1Click(Sender: TObject);
var
D1,D2:TDateTime;
begin
D1:=StrToDateTime('2006-11-29 17:00:00');
D2:=StrToDateTime('2006-12-29 20:30:18');
showmessage(intToStr(Abs(minutesBetween(D1,D2))))
end;
那我怎么把时间加20分钟呢? 比如: now + 20分钟 = newtime
var
d : TDateTime;
begin
d := StrToDateTime('2006-11-11 00:00:00');
d := d+20/1440;
ShowMessage(DateTimeToStr(d));
end;
多谢,多谢,搞定了,我自己用了办法: d := d+20/60/24; 和 wudi_1982(闲半年了,要挣点钱过年了!) 方法一样; lihuasoft(学习低调做人) 的更好些! 马上结贴.给分了.
-------------------------------------
一分没得
lihuasoft(学习低调做人) 的更好些!
-------------------------------------
一分没得-------------------------------------
低调 低调 ~~~=.=