procedure GetMonthDay(const ADate: TDateTime;
var AMonthFirst, AMonthLast: TDateTime);
var
Year, Month, Day: Word;
begin
DecodeDate(ADate, Year, Month, Day);
AMonthFirst := EncodeDate(Year, Month, 1);
if Month + 1 > 12 then
AMonthLast := EncodeDate(Year + 1, 1, 1) - 1
else
AMonthLast := EncodeDate(Year, Month + 1, 1) - 1
end;
procedure GetMonthDay(const ADate: TDateTime;
var AMonthFirst, AMonthLast: TDateTime);
var
Year, Month, Day: Word;
begin
DecodeDate(ADate, Year, Month, Day);
AMonthFirst := EncodeDate(Year, Month, 1);
AMonthLast := EncodeDate(Year, Inc(Month), 1) - 1
end;
每月第一天:Encodedate(year,month,1);
每月最后一天:Encodedate(year,Inc(month),1)-1;
第一天:StrToDate('2000-01-01')
最后一天:strToDate('2000-02-01')-1
var AMonthFirst, AMonthLast: TDateTime);
var
Year, Month, Day: Word;
begin
DecodeDate(ADate, Year, Month, Day);
AMonthFirst := EncodeDate(Year, Month, 1);
if Month + 1 > 12 then
AMonthLast := EncodeDate(Year + 1, 1, 1) - 1
else
AMonthLast := EncodeDate(Year, Month + 1, 1) - 1
end;
procedure GetMonthDay(const ADate: TDateTime;
var AMonthFirst, AMonthLast: TDateTime);
var
Year, Month, Day: Word;
begin
DecodeDate(ADate, Year, Month, Day);
AMonthFirst := EncodeDate(Year, Month, 1);
AMonthLast := EncodeDate(Year, Inc(Month), 1) - 1
end;
每月第一天:Encodedate(year,month,1);
每月最后一天:Encodedate(year,Inc(month),1)-1;
第一天:StrToDate('2000-01-01')
最后一天:strToDate('2000-02-01')-1