uses
  DateUtils;procedure TForm1.FormCreate(Sender: TObject);
begin
(*
function StartOfTheMonth(const AValue: TDateTime): TDateTime;
function EndOfTheMonth(const AValue: TDateTime): TDateTime;
function StartOfAMonth(const AYear, AMonth: Word): TDateTime;
function EndOfAMonth(const AYear, AMonth: Word): TDateTime;
*)
  Caption := DateToStr(StartOfTheMonth(Date));
end;

解决方案 »

  1.   

    uses DateUtils;
    uses DateUtils;
    uses DateUtils;
    uses DateUtils;
    uses DateUtils;
    //for Delphi6//如果你用的是Delphi5则加function StartOfTheMonth(const AValue: TDateTime): TDateTime;
    var
      LYear, LMonth, LDay: Word;
    begin
      DecodeDate(AValue, LYear, LMonth, LDay);
      Result := EncodeDate(LYear, LMonth, 1);
    end;
      

  2.   

    uses DateUtils;
    uses DateUtils;
    uses DateUtils;
    uses DateUtils;
    uses DateUtils;
    //for Delphi6//如果你用的是Delphi5则加function StartOfTheMonth(const AValue: TDateTime): TDateTime;
    var
      LYear, LMonth, LDay: Word;
    begin
      DecodeDate(AValue, LYear, LMonth, LDay);
      Result := EncodeDate(LYear, LMonth, 1);
    end;