懒得想了,请帮忙!

解决方案 »

  1.   

    DateUtils;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;懒得写例子~~
      

  2.   

    zswangII(伴水清清),懒得好。不过zswangII(伴水)可没你那么懒喔。
    能不能写得详?
      

  3.   

    麻烦,要是不写,你就懒得结贴给分了~~
    顾名思义呗~~
    StartOfTheMonth //这个月的开始
    EndOfTheMonth //这个月的结束
    //参考
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      Caption := Format('%s-%s', [
        FormatDateTime('yyyy-mm-dd', StartOfAMonth(2003, 08)),
        FormatDateTime('yyyy-mm-dd', EndOfAMonth(2003, 08))]);
    end;
      

  4.   

    var
      i:integer;
      Start,End:TDate;
    bgein
      for i:= 1 to 12 do
        begin
          Start := StartOfTheMonth(StrToDate(''''+inttostr(Year) +'-'+inttostr(i)+'-1'''));
    Start := EndOfTheMonth(StrToDate(''''+inttostr(Year) +'-'+inttostr(i)+'-1'''));
        Showmessage(inttostr(I)+'月:第一天('+DateTostr(Start)+')|最后一天'+DateToStr(End)+')');
        end;
    end;Year变量是你输入的年
      

  5.   

    Start := EndOfTheMonth(StrToDate(''''+inttostr(Year) +'-'+inttostr(i)+'-1'''));
    改成
    End := EndOfTheMonth(StrToDate(''''+inttostr(Year) +'-'+inttostr(i)+'-1'''));