请问有没有这样的库啊?比如2009年2月最大天数是28。

解决方案 »

  1.   

    Convert.ToDateTime("2008-03-01").AddDays(-1).Day.ToString()
      

  2.   

    switch(month)
    {
      case: 1
        reurn 31;
    }笨方法就是这样咯
      

  3.   

    int daysInMonth = DateTime.DaysInMonth(2008, 8);
      

  4.   

    求一个月的第一天和最后一天
    int year = DateTime.Now.Year;
    int month = DateTime.Now.Month;
    DateTime firstDayOfThisMonth = new DateTime(year, month, 1);
    DateTime lastDayOfThisMonth = new DateTime(year, month, DateTime.DaysInMonth(year, month));
      

  5.   

    int daysInMonth=DateTime.DaysInMonth(2008,8);
    正解
      

  6.   

    一段时间没上CSDN后的第一次接分!