J jackchin Unregistered / Unconfirmed GUEST, unregistred user! 2004-05-11 #2 function GetDaysLeft(D: TDate): Integer; var EndDate: TDate; YY, MM, DD: Word; begin DecodeDate(D, YY, MM, DD); EndDate := EncodeDate(YY, 12, 31); Result := Trunc(EndDate - D) + 1 end;
function GetDaysLeft(D: TDate): Integer; var EndDate: TDate; YY, MM, DD: Word; begin DecodeDate(D, YY, MM, DD); EndDate := EncodeDate(YY, 12, 31); Result := Trunc(EndDate - D) + 1 end;
B bjdribllec Unregistered / Unconfirmed GUEST, unregistred user! 2004-05-11 #3 var si:integer; begin si:=round(encodedate(yearof(date)+1,1,1)-date); Label1.Caption:=IntToStr(si);
T TYZhang Unregistered / Unconfirmed GUEST, unregistred user! 2004-05-11 #4 procedure TForm1.Button1Click(Sender: TObject); var DT:TDateTime; L:Integer; begin DT:=StrToDate(FormatDateTime('yyyy-12-31',now)); L:=Trunc(DT)-Trunc(now); ShowMessage(IntToStr(L)); end;
procedure TForm1.Button1Click(Sender: TObject); var DT:TDateTime; L:Integer; begin DT:=StrToDate(FormatDateTime('yyyy-12-31',now)); L:=Trunc(DT)-Trunc(now); ShowMessage(IntToStr(L)); end;
G goltiger Unregistered / Unconfirmed GUEST, unregistred user! 2004-05-11 #5 to bjdribllec: 为什么yearof函数undeclared
放 放飞 Unregistered / Unconfirmed GUEST, unregistred user! 2004-05-11 #7 使用以下的函数就可以 DaysBetween(Now, EndOfTheYear(Now))