DateTime.DaysInMonth
using System; class MainClass { public static void Main() { int days = DateTime.DaysInMonth(2004, 1); Console.WriteLine("DateTime.DaysInMonth(2004, 1) = " + days); } }