setty
Joined: 01 Apr 2009 Posts: 127 Location: GOLLAPROLU
|
Posted: Tue Feb 23, 2010 11:58 am Post subject: |
|
|
Hi mukundh,
To get Date for First Day of Month you need to use below code:
Define one variable firstDay as DateTime.
DateTime firstDay = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
firstDay = firstDay.AddDays(-(firstDay.Day - 1));
To get Date for Last Day of Month you need to use below code:
Define another variable lastDay as DateTime.
DateTime lastDay = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
lastDay = lastDay.AddMonths(1);
lastDay= lastDay.AddDays(-(lastDay.Day)); _________________ Thanks & Regards
D.B.G.Setty
Software Engineer
NYROS TECHNOLOGIES |
|