var
      FirstDay, LastDay: TDateTime;
    begin
      FirstDay := StrToDate(FormatDateTime('yyyy-MM-01', Now));
      LastDay := IncMonth(FirstDay) - 1;
      ShowMessage(FormatDateTime('yyyy-MM-01', Now)); //本月第一天
      ShowMessage(FormatDateTime('yyyy-mm-dd',IncMonth(FirstDay) - 1)); //本月最后一天
    end;

      posted on 2010-10-21 10:54  sunjun0427  阅读(501)  评论(0编辑  收藏  举报