function DateYear(const ADate: TDateTime): Word;
var
Month, Day: Word;
begin
DecodeDate(ADate, Result, Month, Day);
end;
function DateQuarter(const D: TDateTime): Byte;
var
Year, Month, Day: Word; // year, month and date components of D
begin
DecodeDate(D, Year, Month, Day);
Result := 4 - ((12 - Month) div 3);
end;
function DateMonth(const ADate: TDateTime): Word;
var
Year, Day: Word;
begin
DecodeDate(ADate, Year, Result, Day);
end;
function DateDay(const ADate: TDateTime): Word;
var
Year, Month: Word;
begin
DecodeDate(ADate, Year, Month, Result);
end;
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END