procedure TForm1.FormCreate(Sender: TObject);
var
firstDay,lastDay:TDateTime;
begin
firstDay := StrToDate(FormatDateTime('yyyy-mm-1',Now)); (* 本月第一天 *)
lastDay := IncMonth(firstDay)-1; (* 本月最后一天 *)
mmo1.Lines.Add(DateTimeToStr(firstDay));
mmo1.Lines.Add(DateTimeToStr(lastDay));
end;
end.
转载于:https://www.cnblogs.com/dabiao/archive/2011/09/08/2171775.html