界面库
修正闰年算法
This commit is contained in:
@@ -2175,9 +2175,21 @@ begin
|
||||
xx := array(max(xx1[0],xx2[0]),min(xx1[1],xx2[1]));
|
||||
return 1;
|
||||
end
|
||||
function getmonthdates(y,m);
|
||||
function leapyear(y); //闰年判断
|
||||
begin
|
||||
if not(y mod 4) then
|
||||
begin
|
||||
if not(y mod 100) then
|
||||
begin
|
||||
return not(y mod 400);
|
||||
end
|
||||
return 1;
|
||||
end
|
||||
return 0;
|
||||
end
|
||||
function getmonthdates(y,m); //获得所在月的天数
|
||||
begin
|
||||
if m = 2 then return (not(y mod 4) and ( (y mod 100)))+ 28;
|
||||
if m = 2 then return leapyear(y)+ 28;
|
||||
if m in array(1,3,5,7,8,10,12) then return 31;
|
||||
return 30;
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user