5
Answers

How to find Start and End date for a specified date in ASP.Net

Sreenath G

Sreenath G

13y
2.4k
1

Just use these functions..

 

DateTime lFnGetBeginningOfWeek(DateTime date)

{

 

return date.AddDays(-1 * (int)date.DayOfWeek).Date;

 

}

 

 

DateTime lFnGetEndOfWeek(DateTime aDate)

{

return aDate.AddDays(6 - (int)aDate.DayOfWeek);

}

 

 

Answers (5)
0
Suthish Nair

Suthish Nair

NA 30.5k 7.2m 13y
Subject is wrong. The function returns week star/end date for given date.
0
Sreenath G

Sreenath G

NA 233 315.1k 13y
my bad..
0
Praveen Kumar

Praveen Kumar

51 30.2k 11.9m 13y
@Sreenath, Forums are not for posting articles. Forums are for queries one face during development. So make sure not to post such things in forums.
0
Sreenath G

Sreenath G

NA 233 315.1k 13y
No..actually this was an artical sort..
0
Muralidharan Deenathayalan

Muralidharan Deenathayalan

177 10.9k 2.5m 13y
Are you facing any issues here?