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;
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;
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;
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;