判断是否是闰年的方法,很简单噢

  直接上代码:

     /// <summary>
        /// 判断是否闰年?
        /// </summary>
        /// <param name="a_year"></param>
        /// <returns></returns>
        public static bool IsLeapYear(int a_year)
        {
            String s;
            DateTime dt;
            try
            {
                s = (a_year.ToString() + "-02-29");
                dt = Convert.ToDateTime(s);
                return true;
            }
            catch
            {
                return false;
            }
        }

 

posted @ 2013-11-27 10:28  @大龙哥  阅读(2331)  评论(10编辑  收藏  举报