利用Procedure DecodeDate(Date:TDateTime, var Year, Month, Day: Word);
例如:
var
Present: TDateTime;
Year, Month, Day, Hour : Word;
begin
Present:= Now;
DecodeDate(Present, Year, Month, Day);
Label1.Caption := 'Today is Day ' + IntToStr(Day) + ' of Month '
+ IntToStr(Month) + ' of Year ' + IntToStr(Year);
end;
另外用:FormatDateTime('yyyy',now);也可以