http://anuraj.wordpress.com/2007/12/03/last-day-and-first-day-of-the-month-using-c/
//Get startday of month
DateTime firstDay = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
//Get endday of month
DateTime.DaysInMonth(DateTime.Now.Year,DateTime.Now.Month)
if day is 1 of any month use DateTime.Now.DayOfWeek returns dayname
else DateTime.Now.AddDays(-(DateTime.Now.Day-1)).DayOfWeek returns dayname
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment