procedure TForm1.Button1Click(Sender: TObject);
var
present: TDate;
FirstDate: TDate;
LastDate: TDate;
Year, Month, Day: Word;
begin
Present:= Date;
DecodeDate(Present, Year, Month, Day);
FirstDate:=EncodeDate(Year, Month, 1);
if Month=12 then
LastDate:=EncodeDate(Year, Month,31)
else
LastDate:=EncodeDate(Year, Month+1, 1) - 1;
end;