Delphi 2010 相關文件及程式庫 > Delphi 2010 範例及函式庫

日曆相關程序函數庫

(1/1)

admin:

--- Code: ---function GetMonthEndDateValue(InputYear:integer;InputMon:integer):tdatetime;
var
tmpDay:integer;
begin
  case inputmon of
  1:tmpday:=31;
  2:
    begin
      if isleapyear(inputyear) then
        tmpday:=29
      else
        tmpday:=28;
    end;
  3:tmpday:=31;
  4:tmpday:=30;
  5:tmpday:=31;
  6:tmpday:=30;
  7:tmpday:=31;
  8:tmpday:=31;
  9:tmpday:=30;
  10:tmpday:=31;
  11:tmpday:=30;
  12:tmpday:=31;
  end;

  result:=encodedate(inputyear,inputmon,tmpday);

end;

--- End code ---

Navigation

[0] Message Index

Go to full version