Author Topic: 日曆相關程序函數庫  (Read 5862 times)

admin

  • Administrator
  • *****
  • Posts: 0
    • View Profile
日曆相關程序函數庫
« on: December 03, 2011, 01:53:30 AM »
Code: [Select]
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;