You want to determine date information, such as what day of the week a given date falls on, whether a year is a leap year, and how many days are in a month.
Use a Calendar-derived class from the System.Globalization namespace, such as GregorianCalendar, or use the properties of a DateTime object.
The System.Globalization namespace includes classes that contain culture-related calendar information. These classes derive from the base class Calendar and include GregorianCalendar (the Western standard), HebrewCalendar, JulianCalendar, JapaneseCalendar, and so on.
The Calendar classes define a number of basic methods, including:
GetDaysInMonth returns the number of days in a given ...