DateTime.DaysInMonth(2010, 01);
var lastDayOfMonth = DateTime.DaysInMonth(date.Year, date.Month);
bool IsLeapYear(int nYear) { return (nYear % 4) == 0 && ((nYear % 100) != 0 || (nYear % 400) == 0); } // Get number of days per month. NOTE: nMonth is 1 based! int GetDaysOfMonth(int nYear, int nMonth) { return 31 - ((nMonth == 2) ? (3 - IsLeapYear(nYear)) : (((nMonth - 1) % 7 ) % 2)); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)