function BOFM(date1:TDateTime):TDateTime; //月初
function EOFM(date1:TDateTime):TDateTime; //月末
//月初
function BOFM(Date1:TDateTime):TDateTime;
var
Year1,Month1,Day1:word;
begin
DecodeDate(Date1, Year1, Month1, Day1);
Result := EncodeDate(Year1, Month1, 1);
end;
//月末
function EOFM(Date1:TDateTime):TDateTime;
var
Year1,Month1,Day1:word;
begin
DecodeDate(Date1, Year1, Month1, Day1);
Result := EncodeDate(Year1, Month1, DayOfMonth(Year1,Month1) );
end;