int getDaysByYearAndMonth(int year, int month)
{
int result;
if (2==month)
{
if(year%4==0&&year%100!=0||year%400==0){
result=29;
}else{
result=28;
}
}
else if (month==4||month==6||month==9||month==11)
{
result=30;
}
else{
result=31;
}
return result;
}
根据年和月获取当月天数的函数
最新推荐文章于 2024-01-18 17:48:37 发布