![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
1个回答
展开全部
function getDays(year,month,day)
local leapYear={31,29,31,30,31,30,31,31,30,31,30,31}
local commonYear={31,28,31,30,31,30,31,31,30,31,30,31}
local templateYear
local count
if year %4 ==0 then
templateYear=leapYear
else
templateYear=commonYear
end
for i=1,month-1 do
count =count +templateYear[i]
end
count =count+day
return count
end
1 |
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询