Thursday, 5 January 2012

Get Last Date And First Date Of The Month, Using C#


DateTime firstDay= new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
 int DaysinMonth = DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month)-1;
DateTime lastDay = firstDay.AddDays(DaysinMonth);

No comments:

Post a Comment