var YY,MM,s:string; begin s:=DateToStr(date ); YY:=copy(s,1,4); MM:=copy(s,6,2); if MM[2]='-' then MM[2]:=chr(0);edit1.Text:=‘Year='+YY+' Month='+MM; end;
var YY,MM,s:string; begin s:=DateToStr(date ); YY:=copy(s,1,4); MM:=copy(s,6,2); if MM[2]='-' then MM[2]:=chr(0);edit1.Text:=‘Year='+YY+' Month='+MM; end;
WeekOf(const AValue: TDateTime)
YY,MM,s:string;
begin
s:=DateToStr(date );
YY:=copy(s,1,4);
MM:=copy(s,6,2);
if MM[2]='-' then MM[2]:=chr(0);edit1.Text:=‘Year='+YY+' Month='+MM;
end;
这种方法可不可以呢?如果可以,该怎么实现?
Edit1.Text:=floattostr(YearOf(const AValue: TDateTime));
.....
DayOf(const AValue: TDateTime);
MonthOf(const AValue: TDateTime)
YY,MM,s:string;
begin
s:=DateToStr(date );
YY:=copy(s,1,4);
MM:=copy(s,6,2);
if MM[2]='-' then MM[2]:=chr(0);edit1.Text:=‘Year='+YY+' Month='+MM;
end;