闰年计算

来源:互联网 发布:极速淘宝秒杀器怎么用 编辑:程序博客网 时间:2024/05/01 23:45

if (currentMonth ==1 || currentMonth == 3 ||currentMonth == 5 ||currentMonth == 7 ||currentMonth == 8 ||currentMonth == 10 ||currentMonth == 12)

            {

                return 31;

            }

            else if (currentMonth ==2)

            {

                int yearint = [[yearMulArrayobjectAtIndex:selectedYearRow]intValue ];

                

                if(((yearint %4==0)&&(yearint %100!=0))||(yearint %400==0))

                {

                    return 29;

                }

                else

                {

                    return 28; // or return 29

                }

            }

            else

            {

                return 30;

            }

0 0